diff --git a/.env.example b/.env.example index bac69fc9f..907c41b9c 100644 --- a/.env.example +++ b/.env.example @@ -10,6 +10,13 @@ # PostgreSQL/PostGIS connection (REQUIRED — the service refuses to start without it) DATABASE_URL=postgres://openconditions:openconditions@localhost:5432/openconditions +# Secrets key (REQUIRED): 64 hex characters, from `openssl rand -hex 32`, made +# once. The OAuth2 grants' tokens are encrypted with it; every other +# OpenConditions service of the instance gets a copy of this same key. Keep it in +# your recovery set and out of database backups. +# OPENCONDITIONS_SECRETS_KEY_FILE may name a file holding it instead. +OPENCONDITIONS_SECRETS_KEY= + # HTTP server (optional; defaults shown) PORT=4100 HOST=0.0.0.0 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c89621d10..4f0c73a8c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -122,6 +122,9 @@ jobs: - name: Credential guide up to date run: pnpm check-credentials + - name: Migrations match the schema code + run: pnpm check:migrations + - name: Test run: pnpm test env: diff --git a/.gitignore b/.gitignore index 8790e2135..5d5792333 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ build/ .env .env.* !.env.example +.secrets-key # Logs *.log diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c66b77579..6b0555efa 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -20,7 +20,8 @@ covered by our [Code of Conduct](CODE_OF_CONDUCT.md). - **The data model** — record classes and the registry live in [`@openconditions/model`](packages/model) and its domain modules (roads: [`@openconditions/model-roads`](packages/model-roads)); read helpers and the - database schema in [`@openconditions/core`](packages/core). + database schema in [`@openconditions/core`](packages/core). Schema changes + follow [database migrations](docs/database-migrations.md). - **The OpenLR resolver** — the Python map-matcher in [`services/openlr-resolver`](services/openlr-resolver). - **Bug reports / feature requests** — file an issue with reproduction steps and @@ -61,6 +62,7 @@ TypeScript / Node: pnpm lint # Biome + the import-boundary gate pnpm typecheck # tsc across the workspace (turbo) pnpm check-credentials +pnpm check:migrations # migrations match the schema code (on a committed tree) pnpm check:model pnpm check:feed-schemas pnpm feeds:lint @@ -70,15 +72,7 @@ pnpm check:packed-packages # actual tarball / external ESM, CJS and strict TS co pnpm verify:full # all Node checks above, including the packed consumer ``` -`verify:full` includes lint/import boundaries, workspace and script types, generated credentials, -model artifacts, feed schemas, feed lint, the full Node suite and the packed-package consumer. The latter uses the pinned pnpm CLI and may fetch pinned consumer tools/type dependencies from npm; it retains the actual tarball identity and consumer lock in its receipt. See the [OCPI qualification instructions](packages/ocpi/README.md#qualify-a-tarball-without-publishing) for supplied immutable bytes. It needs Docker/PostGIS for database -tests. For the same OpenLR cross-check as CI, install the hash-pinned -`packages/openlr/python/requirements.txt` into your Python environment, put it on `PATH` and set -`OPENLR_CROSSCHECK=required`. This command does not run the separate resolver checks, independent -interop, dependency audits or container qualification below, or prove live provider/deployment behavior. For a docs-only change, -use scoped Prettier checks; for Node behavior, run focused tests while iterating and `verify:full` before -review. Resolver, wire-format/federation and dependency changes also need their corresponding checks -below. CI retains every applicable gate on every PR. +`verify:full` includes lint/import boundaries, workspace and script types, generated credentials, the migrations drift gate, model artifacts, feed schemas, feed lint, the full Node suite and the packed-package consumer. The latter uses the pinned pnpm CLI and may fetch pinned consumer tools/type dependencies from npm; it retains the actual tarball identity and consumer lock in its receipt. See the [OCPI qualification instructions](packages/ocpi/README.md#qualify-a-tarball-without-publishing) for supplied immutable bytes. It needs Docker/PostGIS for database tests. For the same OpenLR cross-check as CI, install the hash-pinned `packages/openlr/python/requirements.txt` into your Python environment, put it on `PATH` and set `OPENLR_CROSSCHECK=required`. This command does not run the separate resolver checks, independent interop, dependency audits or container qualification below, or prove live provider/deployment behavior. For a docs-only change, use scoped Prettier checks; for Node behavior, run focused tests while iterating and `verify:full` before review. Resolver, wire-format/federation and dependency changes also need their corresponding checks below. CI retains every applicable gate on every PR. Model artifact drift is checked once in CI and `verify:full`, by `scripts/__tests__/model-artifacts.test.ts` during `pnpm test`. That command builds the workspace diff --git a/README.md b/README.md index 264da8950..630b53c19 100644 --- a/README.md +++ b/README.md @@ -110,7 +110,7 @@ services/ deployable services (AGPL-3.0) openlr-resolver/ Python/FastAPI OpenLR → geometry map-matcher (dormant) ``` -The ingest service owns and migrates the `conditions` schema itself, idempotently, on boot. +The ingest service owns and migrates the `conditions` schema itself, idempotently, on boot. The contributions and federation services apply no migrations: they wait at boot until the schema reaches their version (see [database migrations](docs/database-migrations.md#who-migrates)). Instances federate their records with each other: the [federation onboarding guide](docs/federation-onboarding.md) covers running and peering an instance, and the [federation wire protocol](docs/federation-protocol.md) specifies what instances exchange. @@ -122,11 +122,15 @@ Requires Node 24+ and pnpm 11+ (and a reachable PostGIS). pnpm install pnpm build +# Once: the secrets key, kept in a file Git ignores and reused on every start. +[ -f .secrets-key ] || (umask 077 && openssl rand -hex 32 > .secrets-key) + DATABASE_URL=postgres://postgres:postgres@localhost:5432/openconditions \ +OPENCONDITIONS_SECRETS_KEY_FILE="$PWD/.secrets-key" \ pnpm --filter @openconditions/ingest dev ``` -The service applies its migrations, starts polling the enabled feeds, and serves on `:4100`. +The service applies its migrations, starts polling the enabled feeds, and serves on `:4100`. Keep `.secrets-key`: a start with another key refuses to read what the first one stored (see [secrets encrypted at rest](#secrets-encrypted-at-rest)). ### Public API @@ -185,15 +189,7 @@ their occupancy), the charging domain (charging sites, charge-point status and t webcam layer and its stills) and the hazards domain (the weather alert, wildfire, earthquake and natural event overlays). -OpenMapX passes a community service's `container.environment` to the container verbatim, so the services' -configuration is `configSchema` fields: set the database URL (and the contributions API's grant secret and -reviewer token) once as secrets in the admin services panel. Until they are set, both services stop at boot -and their containers restart in a loop; once they are, apply the change and the services start. Set any -setting there, or as `SERVICE_OPENCONDITIONS_INGEST_` in OpenMapX's `.env`. Settings kept in OpenMapX's -`.env` are applied with `pnpm openmapx services start openconditions-ingest` (which resets every setting saved -only in the admin form, so keep all of them in one place). Settings saved in the form are applied with -**Save & Apply**. See -[services/ingest/README.md](services/ingest/README.md#configuration-under-openmapx). +OpenMapX passes a community service's `container.environment` to the container verbatim, so the services' configuration is `configSchema` fields: set the database URL, the secrets key (the same value in every OpenConditions service, see [secrets encrypted at rest](#secrets-encrypted-at-rest)) and the contributions API's grant secret and reviewer token once as secrets in the admin services panel. Until they are set, both services stop at boot and their containers restart in a loop; once they are, apply the change and the services start. Set any setting there, or as `SERVICE_OPENCONDITIONS_INGEST_` in OpenMapX's `.env`. Settings kept in OpenMapX's `.env` are applied with `pnpm openmapx services start openconditions-ingest` (which resets every setting saved only in the admin form, so keep all of them in one place). Settings saved in the form are applied with **Save & Apply**. See [services/ingest/README.md](services/ingest/README.md#configuration-under-openmapx). See OpenMapX's _Building an external extension_ guide for the full flow. OpenMapX's built-in OpenConditions integration reads roads situations, routing evidence, fuel features, parking sites, charging sites, cameras and @@ -203,6 +199,25 @@ charging layer, the webcam layer and the hazard overlays. A request carrying `Au public-scope. Reads with a bbox fetch stale on-demand feeds first, waiting at most `OPENCONDITIONS_ON_DEMAND_DEADLINE_MS` (default 3000). See [services/ingest/README.md](services/ingest/README.md). +## Secrets encrypted at rest + +OpenConditions keeps three kinds of secret in its tables: the OAuth grants of feeds that need an account login (the access and refresh tokens, for example EUMETSAT's), the contributions API's token-issuer private keys, and the federation service's instance private keys. They are stored encrypted with AES-256-GCM under one key, `OPENCONDITIONS_SECRETS_KEY`. The OpenConditions tables never hold that key. Each value is bound to its table, column and row, so a value copied to another row does not decrypt. A dump of the OpenConditions tables therefore holds none of these secrets in clear. + +The key is 64 hexadecimal characters; surrounding whitespace is ignored. Generate it once, for the ingest service, with `openssl rand -hex 32`. Every other OpenConditions service of the instance that reads these secrets gets a copy of that same value, never a newly generated one: the heavy-feeds ingest process, the contributions API and, when federation is enabled, the federation service. The ingest service's feed-auth command reads the ingest container's key. After migrating, the ingest service seals a fixed check value with its key in `conditions.secrets_key_check`, once. On a fresh install, whichever ingest process starts first, the ingest service or the heavy-feeds ingest process, seals its key, so start the ingest service first, or make sure every service holds the same key before the first start. Every other service waits for that row at start and refuses to start when its key does not open it, with an error saying that its key differs from the one the ingest service sealed. A service that needs the key also refuses to start without it or with a value that is not a key. At start each service decrypts every secret it keeps. A key that cannot decrypt one stops the start with a "wrong key" error that names the table and row, never the key or the value. + +Where the key lives depends on how OpenConditions runs: + +- **Standalone**, the key lives only where the operator puts it: a file named by `OPENCONDITIONS_SECRETS_KEY_FILE` (or the variable `OPENCONDITIONS_SECRETS_KEY` itself), and the operator's recovery set. A database backup holds only the encrypted secrets and is of no use for them without the key, as long as the key file stays out of the backup. +- **Under OpenMapX**, each service's credentials in the admin services panel are separate, so the key is entered once per service: generated for `openconditions-ingest` and copied into the others. OpenMapX mounts it as a file and sets `OPENCONDITIONS_SECRETS_KEY_FILE`. A service that runs from its own compose file beside the extension, such as the federation service or a heavy-feeds ingest process started that way, has no entry in that panel: give it the copy as a mounted file and point `OPENCONDITIONS_SECRETS_KEY_FILE` at it, as the [federation guide's compose example](docs/federation-onboarding.md#deploying-it) does. OpenMapX's credential vault stores the key in OpenMapX's own table `public.service_secret`, in the same database, encrypted with OpenMapX's secrets key (the file `infra/docker/secrets/secrets-key` its render generates). A full database backup therefore holds the OpenConditions key, encrypted, next to the secrets it protects. Such a backup is safe for these secrets only while OpenMapX's secrets key file stays out of it, which is how OpenMapX keeps that file: out of backups, in the recovery set. + +Both keys belong in your recovery set: the OpenConditions secrets key and, under OpenMapX, OpenMapX's secrets key. There is no tool to re-encrypt the secrets under a new key, so a lost key and a compromised key both mean starting over: + +1. Generate a new key and enter it in every OpenConditions service (under OpenMapX, in each service's credentials). +2. Delete the rows of `conditions.secrets_key_check`, `conditions.oauth_grant`, `conditions.issuer_key` and `conditions.federation_instance_key`, then start the services; the ingest service seals the check row with the new key. +3. Log in to every OAuth grant again with the ingest container's feed-auth command (`node dist/feed-auth.js login `). + +The consequences go beyond the logins. The contributions API makes new issuer keys, and crowd tokens issued under the deleted keys no longer redeem. The federation service makes a new instance key, which changes this instance's federation identity: peers that pinned the old key no longer trust this instance until they pin the new one. A database backup taken before the restart brings back rows the new key cannot open, so a service started on such a restore stops with "wrong key" until the old key is back or the steps above are repeated. + ## Crowd reporting Pseudonymous contributors can augment the official feeds with signed diff --git a/docs/container-qualification.md b/docs/container-qualification.md index 066a9c53d..88c9474e7 100644 --- a/docs/container-qualification.md +++ b/docs/container-qualification.md @@ -15,16 +15,9 @@ There is no registry login, push, package write, OIDC or privileged artifact con ## What must execute -`scripts/qualify-container-images.py qualify` builds the selected fixed recipe into an untagged OCI -archive. The image must run as a non-root user, become healthy using its actual image healthcheck, and -pass runtime/native probes on a fresh internal Docker network and owned PG16 database. No host port is -published, no operator database or credentials are used, and provider egress is unavailable. Test-only -grant/reviewer credentials are freshly generated. Database readiness uses a real TCP query to the -fixture database, rather than accepting the image's temporary bootstrap server. - -- Every Node service applies its bundled migrations, returns its status document and exercises native - WebCrypto. Federation's default-disabled status is recorded; this does not prove enabled peer or - public-host behavior. Independent federation interoperability remains a separate CI gate. +`scripts/qualify-container-images.py qualify` builds the selected fixed recipe into an untagged OCI archive. The image must run as a non-root user, become healthy using its actual image healthcheck, and pass runtime/native probes on a fresh internal Docker network and owned PG16 database. No host port is published, no operator database or credentials are used, and provider egress is unavailable. Test-only grant/reviewer credentials and a random secrets key (`OPENCONDITIONS_SECRETS_KEY`) are freshly generated for every image. Database readiness uses a real TCP query to the fixture database, rather than accepting the image's temporary bootstrap server. + +- Ingest applies its bundled migrations. For contributions-api and federation, which apply none and wait at boot for the schema version, the script first applies the source's migrations to the fixture database and records them as the ingest service does. For contributions-api, which also waits for the secrets key check, the script then seals that check row with the throwaway key, as the ingest service does, from a small Node script run inside the image; the service verifies the row with its own code at start, so a seal that drifted from the service's format fails qualification. Every Node service returns its status document and exercises native WebCrypto. Federation's default-disabled status is recorded; this does not prove enabled peer or public-host behavior. Independent federation interoperability remains a separate CI gate. - Ingest additionally exercises its compiled osmium binary on a real OSM fixture, verifies baked feed credentials and migration metadata, and makes an Impit native request to its own health endpoint. Polling is explicitly excluded and the remote feed layer stays off. diff --git a/docs/crowd-reporting-limitations.md b/docs/crowd-reporting-limitations.md index 4771a4a65..bc2def71f 100644 --- a/docs/crowd-reporting-limitations.md +++ b/docs/crowd-reporting-limitations.md @@ -93,6 +93,7 @@ publication. - **Per-record privacy class.** Every crowd record carries the `crowd_pseudonym` privacy class; the reporter's key rests in its provenance and is stripped at every egress (API, emitters, federation, archive). +- **Retention.** A reporter row holds the public key, the reputation, the entitlement window and when the reporter last enrolled. It holds no OSM account id and no e-mail address. The ingest service's records sweep deletes a reporter once both its last enrollment and the end of its entitlement lie more than 12 months back. The deletion takes its votes, refusals and token quotas with it and removes its key from the evidence it gave, which stays as keyless evidence. Token quotas are deleted once their UTC day has ended, and spent tokens a day after their issuer key's validity has ended. The key also rests in the provenance of what the reporter reported: its latest crowd readings, its crowd situations and their revisions, and the federation journal's entries of those situations (peers never receive it; it is removed when an entry is served). The delete removes the key from the readings, situations and revisions, and from the journal entries of every situation still stored, in the same transaction, through a trigger on `conditions.reporter`, so a delete by hand (`DELETE FROM conditions.reporter WHERE key_id = …`) erases the reporter as the sweep does. A hand delete within about 37 days of a situation purge can leave outbox journal entries holding the key until the daily journal prune; the sweep never hits this case, and peers never receive the key. A hand delete should take the crowd's lock first (`SELECT pg_advisory_xact_lock(hashtext('crowd'))` in the same transaction), as the sweep does, so that a report landing at that moment cannot write the key back; a vote or report the reporter was submitting at that moment fails instead of landing. After the delete, one place still holds the key on purpose: the block list keeps a blocked key for as long as the block stands, so a blocked key that enrolls again stays blocked. Crowd readings keep no history, so the history tables never hold a key. - **Probe/speed data is a separate, later, gated layer.** Continuous speed/flow contribution (with distributed aggregation and differential privacy) is out of scope here and is not covered by this page. diff --git a/docs/database-migrations.md b/docs/database-migrations.md new file mode 100644 index 000000000..91aa33077 --- /dev/null +++ b/docs/database-migrations.md @@ -0,0 +1,49 @@ +# Database migrations + +OpenConditions keeps its database schema in the Drizzle schema code under `packages/core/src/db/*schema.ts` and its migrations in `packages/core/drizzle`. `runMigrations()` in `packages/core/src/db/migrate.ts` creates the PostGIS extension and the `conditions` schema, then applies every migration the database has not seen yet, under an advisory lock and in one transaction. + +## Who migrates + +Only the ingest service's processes run `runMigrations()`, at every start: the primary and, when enabled, the heavy-feeds process (`OPENCONDITIONS_INGEST_ROLE=feeds`, the `openconditions-ingest-heavy` service), which shares the primary's role. `runMigrations()` records each applied migration in `conditions.__drizzle_migrations`, inside the schema the migrations build, so the ingest role needs to own nothing but `conditions` (and `CREATE` on the database, which `CREATE SCHEMA IF NOT EXISTS` checks at every start, also once `conditions` exists), the history never mixes with another Drizzle project's in a shared database, and dropping `conditions` drops its history with it. Code sets no `search_path`: the operator sets the roles' search path (`conditions, extensions` under OpenMapX, whose PostGIS lives in the schema `extensions`). + +The contributions and federation services apply no migrations. At start they call `waitForSchemaVersion()` (`packages/core/src/db/schema-version.ts`), which polls every two seconds until `max(created_at)` in `conditions.__drizzle_migrations` is at least the `when` of the last entry in the journal (`meta/_journal.json`) their build ships. A newer ingest that applied later migrations satisfies it too. A missing schema, table or read grant counts as not migrated yet. After `OPENCONDITIONS_SCHEMA_WAIT_TIMEOUT_MS` (default 300000) the service stops with the version it expected and what it found. Reading the version takes `USAGE` on `conditions` and `SELECT` on the history table, no DDL right. Every service image carries the migrations folder next to its entry, so the journal is the same file the ingest service migrates from. While they wait for a first migration that takes longer than about three minutes, the contributions and federation services report unhealthy, and they recover once it finishes. + +## Database roles and grants + +Each OpenConditions service connects as a dedicated role, never as the PostgreSQL superuser; the heavy-feeds process and the federation service share the ingest service's (below). After every migrate, `runMigrations()` calls `conditions.grant_consumer_roles()`, a function of the custom migration that grants two roles by name exactly what they use, each only if it exists. It runs with its caller's rights and no role but its owner (the ingest service's role) may call it: + +- `openmapx_tiles_owner` is OpenMapX's role for its traffic tile. OpenMapX's PostGIS service creates it at every start; it cannot log in and owns the function in OpenMapX's `tiles` schema that the tile server calls, which calls `conditions.segment_flow`. It gets `USAGE` on `conditions`, `SELECT` on `road_segment`, `segment_speed`, `source` and `public_license_policy`, and `EXECUTE` on `segment_flow`, `flow_public_licenses` and `flow_osm_credit`: what the tile reads, so credentials, crowd data and every other table stay unreadable to it. +- `openconditions_contributions` is the contributions service's login, which the operator creates as OpenMapX's community extensions guide describes. It gets `USAGE` on `conditions`, `SELECT` on `conditions.__drizzle_migrations` for the schema version and on `conditions.secrets_key_check` to verify its secrets key, and the table privileges its queries use (the identity columns it inserts into need no grant on their sequences): reporters, block list, reports, votes and evidence, the issuer's keys and tokens, the situations and latest readings reports land on, the fused readings they refresh and the feed readings they are checked against. The federation capture triggers run with its rights when it writes a situation or a latest reading, so it also reads the subscriptions and journals into the outbox. It deletes no reporter: the ingest service's sweep does, as the owner, and the reporter strip trigger runs with the deleting role's rights. + +The ingest service's role (`openconditions_ingest` under OpenMapX) owns `conditions` and needs no grant. The heavy-feeds process connects as the same role, since it migrates, grants and may seal the secrets key check like the primary; a role of its own would fail at `CREATE SCHEMA`, at the migration or at the grant step. The federation service connects as the same role too: at every start it creates and drops partitions of `observation`, which only the table's owner may do. + +`services/ingest/src/__tests__/grants.integration.test.ts` checks that each role holds exactly its grants and renders the traffic tile as a role holding only the tile grants. `services/contributions-api/src/__tests__/role-grants.integration.test.ts` runs the contributions service's flows as a role holding only its grants, so a query that needs a privilege the function does not grant fails there. + +Create both roles before the ingest service first starts, so the contributions service finds its grants as soon as the first migration is done. A role created later, or dropped and created again, gets its grants once the ingest service restarts (or its migrate runs again). + +## The baseline + +The folder holds two migrations. `0000_baseline.sql` is generated by drizzle-kit from the schema code and is never edited by hand. `0001_database_objects.sql` is a `--custom` migration with what drizzle-kit cannot express: the partitioned `observation` table and its index, the storage settings of `observation_latest`, the functions (among them `conditions.segment_flow`, the traffic tile OpenMapX serves), the federation capture triggers, the trigger that strips a deleted reporter's key from what it reported, the federation journal's first epoch and the function that grants the roles above. A test (`packages/core/src/__tests__/migration-files.test.ts`) refuses any other kind of statement in the custom file. Everything drizzle-kit can express, such as tables, columns, defaults, CHECKs, indexes and keys, belongs in the schema code. + +The baseline replaced a history of 107 migrations (`0000` to `0106`). That history is preserved in Git up to commit `09e880bd`. A database created by it is not upgraded: migrating it fails with "relation already exists", and it has to be dropped and created again. + +## Changing the schema + +While no installation has to stay upgradeable, a schema change regenerates the baseline instead of adding a migration: + +1. Copy the body of `packages/core/drizzle/0001_database_objects.sql` aside. +2. Delete the folder with `git rm -r packages/core/drizzle`. +3. Run `pnpm --filter @openconditions/core db:generate --name baseline`. +4. Run `pnpm --filter @openconditions/core db:generate --custom --name database_objects`. +5. Write the saved body, with any change to the objects it holds, into the new custom file. +6. Commit, then run `pnpm check:migrations`, which must pass. + +Every constraint and index is named after its table and columns: `_pkey`, `
__key`, `
__fkey`, `
__idx` and `
__check`. drizzle-orm's `.references()` and an unnamed composite `primaryKey()` cannot carry such a name, so foreign keys are declared with `foreignKey({ name })` and composite primary keys with `primaryKey({ name })`. A partial index that selects rows by more than whether a column is null, an index in another collation than its column's, an index on an expression and a name past PostgreSQL's 63 characters are named for their purpose instead, still with the table as prefix and the kind as suffix. Ids are identity columns generated by default, never `serial`, and a closed set of values gets a CHECK. The schema conventions test in `services/ingest/src/__tests__/baseline-schema.integration.test.ts` checks all of this against the catalog. + +Never run `drizzle-kit generate` against the old files during this procedure. If it prompts, or emits an `ALTER` other than the foreign-key constraints drizzle-kit adds after the tables, the folder was not empty. + +Once the first release containing the baseline is installed, a schema change adds an ordinary incremental migration: change the schema code and run `pnpm --filter @openconditions/core db:generate`. Objects drizzle-kit cannot express go into a migration created with `--custom`. From then on, `0000_baseline.sql` and `0001_database_objects.sql` are never edited or regenerated. + +## Drift gate + +`pnpm check:migrations` (`scripts/check-drizzle-drift.ts`) runs `drizzle-kit check` and `drizzle-kit generate` in `packages/core`, each with a timeout. It passes only when `check` reports "Everything's fine", `generate` reports "No schema changes, nothing to migrate", neither prints an error, and `git status` shows no change in the migrations folder. Checking the messages matters: without a terminal, drizzle-kit refuses a rename question, and fails to load broken schema code, while still exiting 0 and writing nothing. The gate therefore fails when the schema code has a change no migration carries, when drizzle-kit would have to ask, and when the folder has uncommitted changes, so run it on a committed tree. CI runs it in the typecheck and test job. diff --git a/docs/federation-gdpr.md b/docs/federation-gdpr.md index a97f6495e..d2e4f4c13 100644 --- a/docs/federation-gdpr.md +++ b/docs/federation-gdpr.md @@ -57,7 +57,8 @@ The erasure reason is `rights_revoked`. Two concrete mechanisms back the recipient that applies the peer's `rights_revoked` delete. While the fact is live, the inbox admits no delivery of that canonical id — including one that arrives _after_ the erasure through a late page or a backfill. The fact is the - deletion record, never the erased content. + deletion record, never the erased content, and the records sweep deletes it + once its 30 days have passed. - **A journal removal.** The `federation_outbox` journal is otherwise append-only, but a `rights_revoked` tombstone removes the record's earlier create and update entries, so a peer replaying an old cursor can no longer diff --git a/docs/federation-onboarding.md b/docs/federation-onboarding.md index e91a8fb32..75803da16 100644 --- a/docs/federation-onboarding.md +++ b/docs/federation-onboarding.md @@ -308,6 +308,7 @@ these not being right: | `OPENCONDITIONS_FEDERATION_ACTOR` | The actor config (inline JSON or a path): `instanceId`, `baseUrl` (the public origin peers reach the service at), operator, coverage, licence, tier, and the capabilities the operator states: `protocolVersion` (optionally `protocolVersions`) and `convergenceBound`. The schema versions, wire format, delivery modes and filter keys are advertised from the running build, and configuring them, `maxEventRate` or an actor-wide `mtlsRequired` fails the boot. | | `OPENCONDITIONS_FEDERATION_PEERS` | The peers config (inline JSON array or a path): one record per peer with its `instanceId`, `actorUrl`, `trustTier` and `pinnedKeys` (§3), and none naming this instance. | | `OPENCONDITIONS_FEDERATION_ARCHIVE_URL` | Where peers fetch the static archive (default `/archive`, which the operator serves; see [archive.md](./archive.md)). | +| `OPENCONDITIONS_SECRETS_KEY` | The key the instance's private keys are encrypted with, or `…_SECRETS_KEY_FILE` naming a file that holds it: a copy of the ingest service's key, never a newly generated one (see [secrets encrypted at rest](../README.md#secrets-encrypted-at-rest)). The service waits for the ingest service's key check at start. Missing, malformed, different from the ingest service's, or unable to decrypt a stored instance key, it fails the boot. | Optional: @@ -322,6 +323,7 @@ Optional: | `OPENCONDITIONS_FEDERATION_TRUSTED_PROXIES` | Comma-separated addresses or subnets (`10.0.0.2`, `172.18.0.0/16`) of the reverse proxies in front of the service. Only from them are `X-Forwarded-For` and the client certificate header believed (see _Mutual TLS_ below). | | `OPENCONDITIONS_EGRESS_ALLOWED_HOSTS` | Comma-separated host names the service may reach although they resolve to private addresses: a peer, archive, inbox or registry on the same private network. Every other private, loopback or link-local address is refused. | | `OPENCONDITIONS_FETCH_TIMEOUT_MS` | How long a request to a peer may take (default 60000). A peer's archive files have an hour each. | +| `OPENCONDITIONS_SCHEMA_WAIT_TIMEOUT_MS` | How long the service waits at start until the ingest service has migrated the database to this build's schema version or a later one (default 300000). The federation service applies no migrations; after the timeout it stops and names the version it expected and what it found. | | `OPENCONDITIONS_MAX_REDIRECTS` | How many redirects a request to a peer follows (default 5); each hop is checked as the first. | A peer record with `subscribe` makes this instance a subscriber of that peer: @@ -394,18 +396,7 @@ A peer's readings land in the observation history, whose partitions the ingest s ### Keys and rotation -The service creates its Ed25519 instance key on first boot and keeps it in -the database. A key is valid for six months; 30 days before it expires the -service rotates it: the old key endorses the new one (both sign that the new -key is this instance's next), and the actor document serves both, with the -endorsement, until the old one expires. The new key signs only once it has -been served for a week, so every peer has read it. A peer trusts a served key -that a key it pins, or learned this way, endorsed, and keeps it -(`conditions.federation_peer_key`): operators pin each other once, and the -pins carry through every rotation. A learned key is trusted only while the pin -it leads back to stays configured, so removing a pin revokes what it led to. -A peer that does not read the actor document for longer than a key lives (six -months) has to be pinned again. A key pinned for two peers fails the boot. +The service creates its Ed25519 instance key on first boot and keeps it in the database, its private half encrypted with `OPENCONDITIONS_SECRETS_KEY`. Without that key the stored instance keys cannot be used: a lost key means a new instance key, a new federation identity, and every peer pinning this instance again. A key is valid for six months; 30 days before it expires the service rotates it: the old key endorses the new one (both sign that the new key is this instance's next), and the actor document serves both, with the endorsement, until the old one expires. The new key signs only once it has been served for a week, so every peer has read it. A peer trusts a served key that a key it pins, or learned this way, endorsed, and keeps it (`conditions.federation_peer_key`): operators pin each other once, and the pins carry through every rotation. A learned key is trusted only while the pin it leads back to stays configured, so removing a pin revokes what it led to. A peer that does not read the actor document for longer than a key lives (six months) has to be pinned again. A key pinned for two peers fails the boot. ### One process @@ -525,7 +516,10 @@ services: OPENCONDITIONS_FEDERATION_ACTOR: /config/actor.json OPENCONDITIONS_FEDERATION_PEERS: /config/peers.json OPENCONDITIONS_FEDERATION_REGISTRY_CACHE: /data/registry + # A copy of openconditions-ingest's Secrets key, never a new one. + OPENCONDITIONS_SECRETS_KEY_FILE: /run/secrets/openconditions-secrets-key TMPDIR: /data + secrets: [openconditions-secrets-key] volumes: - ./federation:/config:ro - openconditions-federation-data:/data @@ -543,12 +537,18 @@ networks: openmapx: external: true +secrets: + openconditions-secrets-key: + file: ./federation-secrets/secrets-key + volumes: openmapx-openconditions-ingest-data: external: true openconditions-federation-data: ``` +The file `federation-secrets/secrets-key` holds the same value that was entered as the Secrets key of `openconditions-ingest` in OpenMapX's admin services panel, taken from the recovery set. It must be readable by the container's user, and it stays out of the `federation` config folder and out of backups. The service refuses to start with any other key; see [secrets encrypted at rest](../README.md#secrets-encrypted-at-rest). + and the public reverse proxy routes the paths, for example with Caddy: ```text diff --git a/docs/graph-binding.md b/docs/graph-binding.md index bcf723474..556308f3a 100644 --- a/docs/graph-binding.md +++ b/docs/graph-binding.md @@ -47,10 +47,7 @@ reaches the routing outputs. ## The tables -All three live in the `conditions` schema, created by migrations -`0042_record_bindings.sql` and `0044_record_binding_queue.sql`. Each is keyed by -`(record_class, record_id, effect_id)`; `record_class` is `situation` for every -row the binder writes, and `effect_id` is `''` for a record's own location. +All three live in the `conditions` schema, created by the database migrations. Each is keyed by `(record_class, record_id, effect_id)`; `record_class` is `situation` for every row the binder writes, and `effect_id` is `''` for a record's own location. `conditions.record_binding` — one row per location the resolver attempted: @@ -661,7 +658,6 @@ binding of each situation's own location: "unattempted": 30, "obsolete": 10, "unattemptedOrObsolete": 40, - "unknownStatus": 0, "exact": 1103, "likely": 214, "ambiguous": 61, @@ -852,26 +848,8 @@ as normal. Partial edges are not expressible for routing either, so the first and last edge of a span are closed whole. -## Upgrading one-way direction data +## One-way direction The direction-aware importer recognizes explicit `oneway=yes`, `true`, `1` and `-1`. It keeps `osm_road.geom` in OSM node order and stores `oneway_reversed` separately. A reverse one-way road produces only `${way_id}:b`, with geometry running in travel direction. Ordinary one-way roads produce `:f`; bidirectional roads produce both. This change does not add implied motorway, roundabout or mode-specific access rules. -Migrations `0105_osm_oneway_direction` and `0106_invalidate_legacy_road_graph` add the flag, mark any existing graph `rebuilding` and mark stored bindings `obsolete`. Earlier imports discarded reverse direction and misclassified `oneway=1`, so the new column's default cannot repair those rows. Existing road data and event records are retained, but graph-derived route effects are withheld until the graph is ready again. Plan the upgrade and reimport in a maintenance window; a large extract can take time to acquire and rebuild. - -Stop pre-fix ingest workers before applying these migrations, and upgrade all graph-writing workers together. An older worker does not understand the new provenance contract and must not rebuild or reactivate the graph during this upgrade. Normal service startup applies migrations; it does not itself reacquire OSM roads. - -Retain the complete `SEGMENT_REGIONS` configuration and let `SEGMENT_REBUILD_CRON` run the full rebuild: fresh acquisition of every configured region, segment construction, OpenLR encoding, sensor rematching, graph activation and event rebinding. To avoid waiting for the weekly schedule, temporarily choose a maintenance-window cron expression, apply the service settings and restore the usual schedule after completion. Check the stage results and errors; a nonzero total or a ready graph alone does not prove every OpenLR descriptor or event binding succeeded. Do not bypass an undercoverage failure just to complete the upgrade. - -Successful imports now include `way_direction_version: 1` in their stored provenance and configuration fingerprint. Activation refuses legacy fingerprints even when the region configuration is unchanged. Rebuilding segments from the old rows, or restarting the service, is therefore insufficient. Verify a new ready graph generation after reacquisition, inspect the import provenance for each configured region, and check binding coverage and `/feeds/status` before relying on route effects. The complete rebuild removes obsolete `:f`/`:b` segments, refreshes OpenLR descriptors and sensor fractions, and rebinds events under the new generation. - -Activation also rejects legacy direction provenance in retained rows for regions no longer listed in `SEGMENT_REGIONS`: the builder and sensor matcher can still visit those rows. Inspect the stored provenance directly in the database: - -```sql -SELECT region, import_provenance->>'way_direction_version' AS way_direction_version, - count(*) AS ways -FROM conditions.osm_road -GROUP BY region, import_provenance->>'way_direction_version' -ORDER BY region, way_direction_version NULLS FIRST; -``` - -Reacquire every region whose coverage you intend to retain. For a region deliberately retired from this deployment, remove its `osm_road` rows during the maintenance window while the graph is `rebuilding`, then run the complete rebuild to sweep orphan segments and refresh dependent bindings. This is an operator decision; the upgrade does not delete coverage automatically. Do not repair readiness by editing provenance or stamping a version onto old rows. +Successful imports include `way_direction_version: 1` in their stored provenance and configuration fingerprint. Graph activation refuses an import without it, also in retained rows of regions no longer listed in `SEGMENT_REGIONS`, which the builder and sensor matcher can still visit. Earlier imports discarded reverse direction and misclassified `oneway=1`. The databases that held them were created by the migration history before the [baseline](database-migrations.md) and are recreated rather than upgraded; their upgrade procedure is preserved in Git up to commit `09e880bd`. diff --git a/docs/observation-write-load.md b/docs/observation-write-load.md index 7bc0b5d36..413ca89c3 100644 --- a/docs/observation-write-load.md +++ b/docs/observation-write-load.md @@ -67,7 +67,7 @@ A preliminary 64 MiB stress run with a one-second vacuum interval averaged 29% f ### Deploy or roll back the lookup -Deploy the application images normally. This lookup change adds no migration or PostgreSQL setting, and it creates no table conversion period. The previous application images can be restored directly. Continue retaining migration 0091's compact-record decoder as required by the earlier codec rollout. Compare matching production windows using the counters below, including latest update volume, HOT rate, successful source polls and rejected readings. The `readings/lookup` timer now includes the early sealing work, so its individual stage duration is not directly comparable with older images. +Deploy the application images normally. This lookup change adds no migration or PostgreSQL setting, and it creates no table conversion period. The previous application images can be restored directly. Keep the compact-record decoder `conditions.observation_record` as the codec rollout requires. Compare matching production windows using the counters below, including latest update volume, HOT rate, successful source polls and rejected readings. The `readings/lookup` timer now includes the early sealing work, so its individual stage duration is not directly comparable with older images. ### Full-day production result @@ -101,15 +101,15 @@ Mean physical cgroup writes fell from 861 MB to 613 MB (29%), WAL from 321 MB to ### Deploy or roll back fused lineage -Migration 0092 installs the compatible decoder before polling starts. It changes functions only: no rows are scanned or rewritten, and no PostgreSQL settings change. Existing series convert on their next changed reading, replacing their template once. Exclude that conversion period from steady-state measurements. +The database migrations install the compatible decoder before polling starts. Existing series convert on their next changed reading, replacing their template once. Exclude that conversion period from steady-state measurements. -Application rollback may restore the previous images, whose writers emit the old representation. Keep migration 0092's decoder and helper while compact fused rows remain, as well as the compact-identity support from 0091. Do not roll those functions back or bulk rewrite rows. The added cost is lineage reconstruction when a full fused record is read; native records avoid the helper. The private storage format adds a compatibility obligation for future readers and migrations. +Application rollback may restore the previous images, whose writers emit the old representation. Keep the decoder `conditions.observation_record` and its helper `conditions.observation_fusion_provenance` while compact fused rows remain. Do not roll those functions back or bulk rewrite rows. The added cost is lineage reconstruction when a full fused record is read; native records avoid the helper. The private storage format adds a compatibility obligation for future readers and migrations. ## Rollout and rollback -Deploy the decoder migration before any new writer starts. Normal service startup runs migrations before polling. Migration 0091 replaces a function; it does not scan or rewrite the latest table or change PostgreSQL settings. Older rows stay readable and are converted naturally when their next changed reading arrives. The first conversion replaces a series template once, so initial rollout writes are not steady-state measurements. +Normal service startup runs the database migrations, which install the decoder, before polling. Older rows stay readable and are converted naturally when their next changed reading arrives. The first conversion replaces a series template once, so initial rollout writes are not steady-state measurements. -The previous application can be restored without undoing the decoder migration. Its writers emit the old representation, which the new decoder also accepts. Keep migration 0091's decoder while any compact readings remain. Do not replace it with the old decoder as a rollback step, and do not bulk rewrite the table merely to convert rows. +The previous application can be restored without a database change. Its writers emit the old representation, which the decoder also accepts. Keep the decoder while any compact readings remain. Do not replace it with the old decoder as a rollback step, and do not bulk rewrite the table merely to convert rows. ## Production comparison diff --git a/docs/public-stream-reconnect.md b/docs/public-stream-reconnect.md index 2af7b47ab..26a4c0385 100644 --- a/docs/public-stream-reconnect.md +++ b/docs/public-stream-reconnect.md @@ -257,14 +257,14 @@ server tests alone do not establish client correctness. ## Why federation replay is not a shortcut The audited capture in -[`0062_federation_capture.sql`](../packages/core/drizzle/0062_federation_capture.sql) +[`0001_database_objects.sql`](../packages/core/drizzle/0001_database_objects.sql) is subscriber-gated and deliberately omits ordinary feed expiry extensions when revision/evidence do not change; earlier capture excludes peer/on-demand records. Public SSE does not create a federation subscription. Therefore its current visible situations are not guaranteed to be present in that journal. [`outbox.ts`](../packages/federation/src/outbox.ts) correctly uses `(txid, seq)` -ordering with an xmin fence rather than treating a bigserial maximum as a safe +ordering with an xmin fence rather than treating an identity column's maximum as a safe commit frontier. That primitive is worth reusing in a future design, but a separately read snapshot is not automatically aligned with that frontier. Taking a snapshot and a maximum sequence can skip in-flight commits; replaying diff --git a/docs/release-notes/compact-latest-readings.md b/docs/release-notes/compact-latest-readings.md index ed1a824ce..261c57446 100644 --- a/docs/release-notes/compact-latest-readings.md +++ b/docs/release-notes/compact-latest-readings.md @@ -1,8 +1,8 @@ # Compact latest observation storage -Affected versions: Unreleased source builds containing migration 0091 and the compact latest-reading writer. No product version is assigned by this change. +Affected versions: Unreleased source builds containing the compact latest-reading writer and its decoder. No product version is assigned by this change. -Action: Apply the bundled migration before starting the new writer. Normal service startup does this automatically. Migration 0091 replaces the PostgreSQL reconstruction function without rewriting existing rows or changing server settings. New readings gradually adopt the compact representation; their first conversion replaces the series template once. +Action: None. Normal service startup applies the database migrations, which install the PostgreSQL reconstruction function, before the writer starts. New readings gradually adopt the compact representation; their first conversion replaces the series template once. Compatibility: Full API records, measurement times, history, rollups and contributor receipts are preserved. The decoder accepts both representations. When rolling back application images, keep the new decoder: restoring the old decoder would expose incomplete records for compact rows that remain. No full-table rewrite or configuration change is needed. diff --git a/docs/release-notes/database-baseline.md b/docs/release-notes/database-baseline.md new file mode 100644 index 000000000..c3e2846ef --- /dev/null +++ b/docs/release-notes/database-baseline.md @@ -0,0 +1,35 @@ +# Database migration history reset to a baseline + +Affected versions: The first product release containing the baseline and every later one. No product version is assigned by this change. + +Action: Create the OpenConditions database afresh. A database created by an earlier build is not upgraded: its migrations fail with "relation already exists". Drop the `conditions` schema, or the whole database, before starting the new ingest service. Earlier builds kept their history in `drizzle.__drizzle_migrations_oc`; it is no longer read and can be dropped too. + +Set the new required secret `OPENCONDITIONS_SECRETS_KEY` (or `OPENCONDITIONS_SECRETS_KEY_FILE`, a file holding it) on every service that declares it: the ingest service, the heavy-feeds ingest process, the contributions API and, when federation is enabled, the federation service. A service without it, or with a value that is not a key, stops at start. Generate it once, for `openconditions-ingest`, with `openssl rand -hex 32`, and give the others a copy of that same value, never a newly generated one. The first ingest process to start seals it in `conditions.secrets_key_check`, and every other service refuses to start with a different key. Keep the key in your recovery set: the database holds the OAuth tokens and the private keys only encrypted with it, and a lost key means logging in to every OAuth grant again and taking a new federation identity. Under OpenMapX, OpenMapX's credential vault also holds the key, encrypted with OpenMapX's own secrets key, so keep that key in the recovery set too. See [secrets encrypted at rest](../../README.md#secrets-encrypted-at-rest). + +Prepare the database roles before the ingest service first starts. The ingest service's role needs `CREATE` on the database at every start, also once `conditions` exists, because it runs `CREATE SCHEMA IF NOT EXISTS`. The heavy-feeds process and the federation service connect as the ingest service's role. Set the search path of both OpenConditions roles, the ingest service's and the contributions service's, to `conditions, extensions` (`ALTER ROLE … SET search_path = conditions, extensions`; under OpenMapX, PostGIS lives in the schema `extensions`) before the ingest service first starts. OpenConditions sets no search path in code. See [database roles and grants](../database-migrations.md#database-roles-and-grants). + +Only the ingest service's processes migrate now, the primary and the heavy-feeds process, and they record the history in `conditions.__drizzle_migrations`. The contributions and federation services wait at start until the schema reaches their version, for at most `OPENCONDITIONS_SCHEMA_WAIT_TIMEOUT_MS` (five minutes by default). While a first migration runs longer than about three minutes, they report unhealthy, and they recover once it finishes. + +At every start the ingest service grants OpenMapX's tile role `openmapx_tiles_owner` and the contributions service's role `openconditions_contributions` exactly what they use, each if it exists. Create both before the ingest service first starts; a role created later gets its grants when the ingest service restarts. + +The OpenLR resolver's routing graph now lives in its own schema `openlr`; build it again after the upgrade (see below). + +Crowd reporters are kept for 12 months after their last enrollment and entitlement end: the ingest service's records sweep then deletes a reporter with its votes, refusals and token quotas, and its evidence stays without its key. Deleting a reporter, by the sweep or by hand, also removes its key from its crowd readings, situations, revisions and federation journal entries. Two exceptions remain: a hand delete shortly after a situation purge can leave journal entries holding the key until the daily journal prune, and the block list keeps a blocked key for as long as the block stands; see the [crowd reporting limitations](../crowd-reporting-limitations.md#privacy-posture). Ended token quotas, spent tokens a day past their issuer key's validity and federation erasure facts past their 30 days are deleted as well. The reporter table no longer has the unused columns `osm_uid`, `email_lookup_hmac` and `flagged_count`, and votes no longer have `subject_component_key`. + +Compatibility: The resulting schema differs from the one the earlier migrations produced in these ways: + +- Secrets: OAuth tokens and the issuer and federation private keys are stored encrypted, checked against the new `secrets_key_check` table. The columns `oauth_grant.refresh_token`, `oauth_grant.access_token`, `issuer_key.private_key` and `federation_instance_key.private_key` are replaced by `_ciphertext`, `_iv` and `_tag`, each trio with a CHECK named `
__check`. +- Crowd data: the dropped columns and the retention above. New foreign keys to `reporter(key_id)`: `report_evidence_actor_key_id_fkey` (`ON DELETE SET NULL`), and `report_refusal_actor_key_id_fkey`, `sub_claim_key_id_fkey` and `token_quota_key_id_fkey` (`ON DELETE CASCADE`). The new column `spent_token.expires_at timestamptz NOT NULL`. The `sub_claim` unique key covers four columns instead of five (`sub_claim_subject_class_subject_id_key_id_claim_type_key`). +- Functions and triggers: the new functions `conditions.grant_consumer_roles()`, which grants the roles above, and `conditions.reporter_strip_key()`, run by the new `BEFORE DELETE` trigger `reporter_strip_key` on `reporter`. +- Names: every constraint and index is named after its table and columns (`
_pkey`, `
__key`, `
__fkey`, `
__idx`, `
__check`) or, for partial, collated, expression and over-long indexes, after their purpose; the GeoNet coverage CHECK is now `geonet_coverage_order_check`. +- Ids and types: the five `bigserial` ids are identity columns, with the same sequence names; `jma_budget.day` is a `date`; `segment_observation.confidence` is `confidence_score`; `smn_cap_message.retrieval` has no default. +- Checks: closed value sets are checked (level of service, segment speed confidence, binding status and direction, subscription status, erasure reason). +- Indexes: three indexes that a primary key serves or nothing reads are gone, the crowd evidence index keys on the evidence state alone, and `feature` and `offer` have indexes for the records sweep. The crowd sweep has the new indexes `reporter_last_active_at_idx` and `federation_tombstone_expires_at_idx`, and `spent_token_expires_at_idx` replaces `idx_spent_token_spent_at`. +- Storage: 30 tables have a different physical column order with the same columns, among them `observation`, `observation_latest` and `observation_rollup_hourly`, which store their fixed-width columns first. A `SELECT *` or a `COPY` without a column list sees the new order. +- API: the binding metrics of `/feeds/status` no longer carry `unknownStatus`, since a CHECK now rules out a binding status the reader does not know. + +The OpenLR resolver's graph build no longer writes to `conditions`: it creates `osm_nodes` and `osm_lines` in its own schema `openlr`, owned by the role that builds the graph, and the resolver reads them there. A graph built into `conditions` by an earlier build is not read; build it again. The resolver's [README](../../services/openlr-resolver/README.md#database-roles) lists the rights its two roles need. + +The traffic tile function `conditions.segment_flow(integer, integer, integer, json)` is unchanged. Data fixes that the earlier migrations applied to existing rows are not part of the baseline, since a new database has no rows to fix. + +Caveats: The earlier migration history is preserved in Git up to commit `09e880bd`. See [database migrations](../database-migrations.md) for how schema changes are made from now on. diff --git a/docs/speed-coverage.md b/docs/speed-coverage.md index 1a3b1b14a..cee8ba705 100644 --- a/docs/speed-coverage.md +++ b/docs/speed-coverage.md @@ -93,22 +93,9 @@ must not silently invent geometry either. ## Selected display contributors -Migration `0068_flow_field_lineage` adds version 1 field lineage to the live -segment surface. `GET /segments.geojson` properties include `lineage_version: 1`, -`field_sources`, `field_contributors` and `field_lineage_complete`; `conditions.segment_flow` encodes the -three maps as JSON strings in MVT attributes. Each map has independent `speed`, -`freeFlow`, `ratio`, `los`, `confidence` and `geometry` keys when the field's lineage is known. -Source IDs are canonical display identities: a catalogue child credits its parent, -and the OSM segment spine credits `openstreetmap`. - -Display credits have `{ sourceId, name, url?, licensing?, -attributionText?, publisher?: { name, url? }, notes?, retrievedAt? }`. A required -verbatim notice is an additional credit with the parent's source ID and the notice -as its `name`. Deduplicate identical credits, rather than source IDs, so the notice -survives. Migration `0069_captured_licensing` carries captured scoped definitions -through these credits and the OSM geometry credit; it changes functions only. -See [licence metadata](licensing.md) for the display contract. An unknown source keeps its proven ID and any available provenance; -missing catalogue metadata is never replaced with an unrelated feed's credit. +The flow functions in the database migrations (`conditions.flow_*`, `conditions.segment_flow`) add version 1 field lineage to the live segment surface. `GET /segments.geojson` properties include `lineage_version: 1`, `field_sources`, `field_contributors` and `field_lineage_complete`; `conditions.segment_flow` encodes the three maps as JSON strings in MVT attributes. Each map has independent `speed`, `freeFlow`, `ratio`, `los`, `confidence` and `geometry` keys when the field's lineage is known. Source IDs are canonical display identities: a catalogue child credits its parent, and the OSM segment spine credits `openstreetmap`. + +Display credits have `{ sourceId, name, url?, licensing?, attributionText?, publisher?: { name, url? }, notes?, retrievedAt? }`. A required verbatim notice is an additional credit with the parent's source ID and the notice as its `name`. Deduplicate identical credits, rather than source IDs, so the notice survives. Captured scoped definitions travel through these credits and the OSM geometry credit. See [licence metadata](licensing.md) for the display contract. An unknown source keeps its proven ID and any available provenance; missing catalogue metadata is never replaced with an unrelated feed's credit. The speed winner follows tier and freshness. Declared LOS uses every supplier tied at the worst declared rank; otherwise LOS inherits the selected speed ratio's diff --git a/docs/storage.md b/docs/storage.md index 12c84abd9..15477b880 100644 --- a/docs/storage.md +++ b/docs/storage.md @@ -161,15 +161,19 @@ nothing journalled to correct, so it is taken as in sync with its flag. The sweep, every five minutes, takes these actions: -| What | Action | -| ------------------------------------------------------------------- | ------------------------------------------------------------- | -| A record whose `freshness.expiresAt` has passed | Tombstoned `expired` | -| A feed record of a source with no successful poll for an hour | Tombstoned `expired` | -| A peer's copy without expiry, its peer silent about its source | Tombstoned `expired`, back when the peer's liveness returns | -| A record tombstoned more than `OPENCONDITIONS_HISTORY_DAYS` (7) ago | Purged with its revisions, bindings, crowd evidence and votes | -| A revision recorded more than `OPENCONDITIONS_HISTORY_DAYS` ago | Deleted, unless it is its record's latest | -| An on-demand row at expiry | Deleted (it was a cache, with no history) | -| A series of a transient property past its reading's expiry | Deleted, bulk or on demand (nothing else ends it) | +| What | Action | +| ---------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | +| A record whose `freshness.expiresAt` has passed | Tombstoned `expired` | +| A feed record of a source with no successful poll for an hour | Tombstoned `expired` | +| A peer's copy without expiry, its peer silent about its source | Tombstoned `expired`, back when the peer's liveness returns | +| A record tombstoned more than `OPENCONDITIONS_HISTORY_DAYS` (7) ago | Purged with its revisions, bindings, crowd evidence and votes | +| A revision recorded more than `OPENCONDITIONS_HISTORY_DAYS` ago | Deleted, unless it is its record's latest | +| An on-demand row at expiry | Deleted (it was a cache, with no history) | +| A series of a transient property past its reading's expiry | Deleted, bulk or on demand (nothing else ends it) | +| A crowd reporter whose last enrollment and entitlement end lie over 12 months back | Deleted, with its votes, refusals and token quotas, and its key removed from what it reported; its evidence stays without its key | +| A token quota of a UTC day that has ended | Deleted | +| A spent token a day past its issuer key's validity | Deleted (the token can no longer be redeemed) | +| A federation erasure fact past its 30 days | Deleted | A peer's copy without an expiry of its own lives as long as its peer says so, so a peer that goes dark would leave it live here for good. Only for a peer @@ -189,6 +193,8 @@ publishes an ended record keeps it, and reads filter by time. A source whose lock stays held past the sweep's `lock_timeout` (a long publication) is left to the next sweep and counted as `busy`. +The crowd and federation bookkeeping is deleted in batches of 500 rows, one transaction each, so the sweep never holds a long lock on it. A row another transaction holds, such as a reporter enrolling at that moment, is skipped and left to the next sweep. A reporter batch takes the crowd's lock first, as a landing does, then its reporter rows; deleting a reporter also removes its key from its latest crowd readings, crowd situations, their revisions and their journal entries, through a trigger on `conditions.reporter` that a delete by hand fires too. A spent token is kept a day past its expiry, so a contributions service whose clock runs behind still finds it. A reporter's `last_active_at` and `entitlement_expires_at` are both required, and both must lie more than 12 months back. Enrolling again after the deletion starts a new reporter with the cohort's prior reputation; a key on the block list stays blocked, since the block list is kept. + ## Observations `observation_latest` is the series registry: one row per subject, property, diff --git a/feeds/README.md b/feeds/README.md index 36141eae6..a58b8d70f 100644 --- a/feeds/README.md +++ b/feeds/README.md @@ -628,22 +628,7 @@ publisher that issues no static key (EUMETSAT's Data Store): }, ``` -`clientId` names the field holding the public client's id, and its owner names -the grant: the shared group (`eumetsat`), so one login serves every feed of the -account, else the feed. The tokens are no configuration but state in the -database (`conditions.oauth_grant`): `node dist/feed-auth.js login ` -in the ingest container (`pnpm --filter @openconditions/ingest feed-auth` in a -checkout) prints the login URL and exchanges the authorization code pasted -back with PKCE; `import ` stores a refresh token read from stdin -instead, after spending it on one refresh; `status` shows each grant, never a -token. The service then refreshes the access token before it expires, under -the grant's row lock so two ingest processes never spend one refresh token, -and stores the refresh token the provider rotated before the new access token -is used; a refresh token older than half its `refreshTokenTtlSec` is renewed -even while the access token is valid. A grant with no login, or whose refresh -token the provider refused, fails its feeds' polls with the command to run and -sends the provider nothing until the operator logs in again. The feeds of one -grant must write the same `auth`; an `on_demand` feed cannot use it. +`clientId` names the field holding the public client's id, and its owner names the grant: the shared group (`eumetsat`), so one login serves every feed of the account, else the feed. The tokens are no configuration but state in the database (`conditions.oauth_grant`), encrypted with the instance's `OPENCONDITIONS_SECRETS_KEY`: `node dist/feed-auth.js login ` in the ingest container (`pnpm --filter @openconditions/ingest feed-auth` in a checkout) prints the login URL and exchanges the authorization code pasted back with PKCE; `import ` stores a refresh token read from stdin instead, after spending it on one refresh; `status` shows each grant, never a token. The service then refreshes the access token before it expires, under the grant's row lock so two ingest processes never spend one refresh token, and stores the refresh token the provider rotated before the new access token is used; a refresh token older than half its `refreshTokenTtlSec` is renewed even while the access token is valid. A grant with no login, or whose refresh token the provider refused, fails its feeds' polls with the command to run and sends the provider nothing until the operator logs in again. The feeds of one grant must write the same `auth`; an `on_demand` feed cannot use it. `expand` names a field whose value is a comma-separated list: the endpoint's URL is filled once per item (one Mobilithek client pull per subscription id), and an @@ -1109,7 +1094,7 @@ unprivileged PR execution without provider secrets; it is not a new required che Five canonical categories are represented as components: car, ordinary motorcycle, bus, disabled and pregnancy/family. Reserved categories overlap vehicle totals and are never summed. A car count is not a site-wide total. Heavy motorcycles remain in retained raw XML because the current vehicle/user-group identity cannot distinguish them from ordinary motorcycles. Negative values including `-9`, missing values, malformed counts and counts above capacity produce no reading; zero remains zero. No open/closed state is inferred. -Site coordinates use TWD97 TM2 121 (EPSG:3826), independently checked against PROJ 9.8.1. Entrance `Xcod` is latitude and `Ycod` longitude. Multiple valid entrances are retained; missing and zero placeholders are omitted. Invalid site geometry rejects the candidate instead of withdrawing a previous site. Root `UPDATETIME` is a publication snapshot in Asia/Taipei, not an individual counter measurement. Observations are dated to that snapshot and retain `provenance.sourceUpdatedAt` separately from `freshness.fetchedAt`. Status snapshots must be younger than the configured 1,800 seconds and cannot be future-dated. Inventory has a two-day maximum source age to allow daily acquisition. Publisher expiry caps API validity and fusion even for bulk change-only counts. The last accepted publisher clock is stored transactionally under the source lock. A newer publication within the age limit is accepted even when it predates the previous retrieval. Same-clock and backwards publications cannot advance source success. HTTP 304 validates transport separately and still checks the retained XML clocks; it cannot renew publisher freshness. Held failed roles cannot authorize publication. Migration `0093_source_publication_clock` adds the durable clock independently of other feed PRs. +Site coordinates use TWD97 TM2 121 (EPSG:3826), independently checked against PROJ 9.8.1. Entrance `Xcod` is latitude and `Ycod` longitude. Multiple valid entrances are retained; missing and zero placeholders are omitted. Invalid site geometry rejects the candidate instead of withdrawing a previous site. Root `UPDATETIME` is a publication snapshot in Asia/Taipei, not an individual counter measurement. Observations are dated to that snapshot and retain `provenance.sourceUpdatedAt` separately from `freshness.fetchedAt`. Status snapshots must be younger than the configured 1,800 seconds and cannot be future-dated. Inventory has a two-day maximum source age to allow daily acquisition. Publisher expiry caps API validity and fusion even for bulk change-only counts. The last accepted publisher clock is stored transactionally under the source lock. A newer publication within the age limit is accepted even when it predates the previous retrieval. Same-clock and backwards publications cannot advance source success. HTTP 304 validates transport separately and still checks the retained XML clocks; it cannot renew publisher freshness. Held failed roles cannot authorize publication. The durable clock is the source's publication clock in `conditions.source_status` (`last_publication_at`), kept per source and independent of other feeds. The authored feed is enabled for partial inventory and the five supported availability categories, with `taipei.qualifiedSnapshot: false`. Missing features and series retain their last-good records; source-based expiry removes stale availability from public output even when no later poll succeeds. Full-snapshot authority remains separate: `taipei.qualifiedSnapshot: true` grants inventory withdrawal and omitted-series ending only after independent evidence establishes those semantics. Syntactic XML validity, received-row accounting, HTTP 200 and absence of pagination do not establish completeness. The catalogue does not claim a physical parking census. This parser never grants offer withdrawal authority. Existing shrink confirmation still requires three qualifying polls over at least ten minutes for large reductions. Empty, failed, error, truncated, duplicate-ID and orphan-status documents fail without replacing the last good publication. Daily sites and five-minute status cadences are conservative operator choices, not provider quotas or service guarantees. diff --git a/package.json b/package.json index ecdf0aaba..fa9a8b14c 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "clean": "turbo run clean && rm -rf node_modules", "typecheck": "turbo run typecheck && tsc -p scripts/tsconfig.json", "check:staged": "node scripts/check-staged.mjs", - "verify:full": "pnpm lint && pnpm typecheck && pnpm check-credentials && pnpm check:feed-schemas && pnpm feeds:lint && pnpm test && pnpm check:packed-packages", + "verify:full": "pnpm lint && pnpm typecheck && pnpm check-credentials && pnpm check:migrations && pnpm check:feed-schemas && pnpm feeds:lint && pnpm test && pnpm check:packed-packages", "lint": "biome check . && prettier --check \"**/*.{md,yml,yaml}\" && pnpm check-import-boundaries", "format": "biome format --write . && prettier --write \"**/*.{md,yml,yaml}\"", "check-import-boundaries": "tsx scripts/check-import-boundaries.ts", @@ -18,6 +18,7 @@ "build:domains": "turbo run build --filter=@openconditions/datex2... --filter=@openconditions/ocpi... --filter=@openconditions/roads... --filter=@openconditions/fuel... --filter=@openconditions/parking... --filter=@openconditions/charging... --filter=@openconditions/cameras... --filter=@openconditions/hazards... --filter=@openconditions/weather... --filter=@openconditions/vehicles... --filter=@openconditions/border... --output-logs=errors-only", "gen:credentials": "pnpm build:domains && tsx scripts/gen-credentials.ts --write", "check-credentials": "pnpm build:domains && tsx scripts/gen-credentials.ts", + "check:migrations": "pnpm --filter @openconditions/model build && node scripts/check-drizzle-drift.ts", "gen:feed-schemas": "pnpm build:domains && tsx scripts/gen-feed-schemas.ts --write", "check:feed-schemas": "pnpm build:domains && tsx scripts/gen-feed-schemas.ts", "feeds:lint": "pnpm build:domains && tsx scripts/feeds-lint.ts", diff --git a/packages/core/drizzle.config.ts b/packages/core/drizzle.config.ts index b2e63071a..cbe3bd23d 100644 --- a/packages/core/drizzle.config.ts +++ b/packages/core/drizzle.config.ts @@ -1,10 +1,13 @@ import { defineConfig } from "drizzle-kit"; -// Generates versioned SQL migrations in ./drizzle from the Drizzle schema. -// Run `pnpm --filter @openconditions/core db:generate` after changing schema.ts, -// then review (do not hand-edit) the generated migration. The PostGIS extension -// and `conditions` schema are created in runMigrations(), not in a migration — -// drizzle-kit does not model `CREATE EXTENSION` and omits `CREATE SCHEMA` here. +// Generates the SQL migrations in ./drizzle from the Drizzle schema: a +// generated baseline, and a `--custom` file with what drizzle-kit cannot +// express (functions, triggers, the partitioned observation table, storage +// settings, seed rows). Generated files are never hand-edited. How a schema +// change becomes a migration is described in docs/database-migrations.md. +// The PostGIS extension and `conditions` schema are created in runMigrations(), +// not in a migration — drizzle-kit does not model `CREATE EXTENSION` and omits +// `CREATE SCHEMA` here. export default defineConfig({ schema: "./src/db/*schema.ts", out: "./drizzle", diff --git a/packages/core/drizzle/0000_baseline.sql b/packages/core/drizzle/0000_baseline.sql new file mode 100644 index 000000000..e7c0411de --- /dev/null +++ b/packages/core/drizzle/0000_baseline.sql @@ -0,0 +1,1040 @@ +CREATE TABLE "conditions"."binding_queue" ( + "record_class" text NOT NULL, + "record_id" text NOT NULL, + "effect_id" text DEFAULT '' NOT NULL, + "record_revision" integer NOT NULL, + "attempts" integer DEFAULT 0 NOT NULL, + "next_attempt_at" timestamp with time zone DEFAULT now() NOT NULL, + "last_error" text, + "updated_at" timestamp with time zone DEFAULT now() NOT NULL, + CONSTRAINT "binding_queue_pkey" PRIMARY KEY("record_class","record_id","effect_id") +); +--> statement-breakpoint +CREATE TABLE "conditions"."record_binding" ( + "record_class" text NOT NULL, + "record_id" text NOT NULL, + "effect_id" text DEFAULT '' NOT NULL, + "status" text NOT NULL, + "confidence" double precision, + "direction_mode" text NOT NULL, + "candidate_count" integer DEFAULT 0 NOT NULL, + "alternative_confidence" double precision, + "reason" text, + "resolver_version" text NOT NULL, + "geom_hash" text NOT NULL, + "record_revision" integer NOT NULL, + "graph_generation" text, + "bound_at" timestamp with time zone NOT NULL, + CONSTRAINT "record_binding_pkey" PRIMARY KEY("record_class","record_id","effect_id"), + CONSTRAINT "record_binding_record_class_check" CHECK ("record_class" IN ('feature', 'situation', 'observation', 'offer')), + CONSTRAINT "record_binding_status_check" CHECK ("status" IN ('exact', 'likely', 'ambiguous', 'unresolved', 'no_coverage', 'not_applicable', 'obsolete')), + CONSTRAINT "record_binding_direction_mode_check" CHECK ("direction_mode" IN ('single', 'both', 'unknown')) +); +--> statement-breakpoint +CREATE TABLE "conditions"."record_segment" ( + "record_class" text NOT NULL, + "record_id" text NOT NULL, + "effect_id" text DEFAULT '' NOT NULL, + "seq" smallint NOT NULL, + "segment_id" text NOT NULL, + "way_id" bigint NOT NULL, + "dir" text NOT NULL, + "start_fraction" double precision NOT NULL, + "end_fraction" double precision NOT NULL, + CONSTRAINT "record_segment_pkey" PRIMARY KEY("record_class","record_id","effect_id","seq") +); +--> statement-breakpoint +CREATE TABLE "conditions"."report_evidence" ( + "id" bigint PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY (sequence name "conditions"."report_evidence_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 9223372036854775807 START WITH 1 CACHE 1), + "record_class" text NOT NULL, + "record_id" text NOT NULL, + "component_key" text DEFAULT '' NOT NULL, + "evidence_kind" text NOT NULL, + "actor_key_id" text, + "source_id" text, + "occurred_at" timestamp with time zone NOT NULL, + "details" jsonb DEFAULT '{}'::jsonb NOT NULL, + CONSTRAINT "report_evidence_evidence_kind_check" CHECK ("evidence_kind" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')), + CONSTRAINT "report_evidence_record_class_check" CHECK ("record_class" IN ('feature', 'situation', 'observation', 'offer')) +); +--> statement-breakpoint +CREATE TABLE "conditions"."report_refusal" ( + "id" bigint PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY (sequence name "conditions"."report_refusal_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 9223372036854775807 START WITH 1 CACHE 1), + "actor_key_id" text NOT NULL, + "cell" text NOT NULL, + "occurred_at" timestamp with time zone NOT NULL +); +--> statement-breakpoint +CREATE TABLE "conditions"."sub_claim" ( + "id" text PRIMARY KEY NOT NULL, + "subject_class" text NOT NULL, + "subject_id" text NOT NULL, + "claim_type" text NOT NULL, + "key_id" text NOT NULL, + "reason" text, + "geom" geometry(Point, 4326), + "signature" text NOT NULL, + "created_at" timestamp with time zone NOT NULL, + CONSTRAINT "sub_claim_subject_class_subject_id_key_id_claim_type_key" UNIQUE("subject_class","subject_id","key_id","claim_type"), + CONSTRAINT "sub_claim_claim_type_check" CHECK ("claim_type" IN ('confirm', 'negate', 'flag')), + CONSTRAINT "sub_claim_subject_class_check" CHECK ("subject_class" IN ('feature', 'situation', 'observation', 'offer')) +); +--> statement-breakpoint +CREATE TABLE "conditions"."jma_budget" ( + "egress" text NOT NULL, + "day" date NOT NULL, + "used" bigint DEFAULT 0 NOT NULL, + "reserved" bigint DEFAULT 0 NOT NULL, + CONSTRAINT "jma_budget_pkey" PRIMARY KEY("egress","day"), + CONSTRAINT "jma_budget_nonnegative_check" CHECK ("conditions"."jma_budget"."used" >= 0 AND "conditions"."jma_budget"."reserved" >= 0) +); +--> statement-breakpoint +CREATE TABLE "conditions"."jma_download" ( + "url" text PRIMARY KEY NOT NULL, + "value" jsonb NOT NULL +); +--> statement-breakpoint +CREATE TABLE "conditions"."jma_state" ( + "source" text PRIMARY KEY NOT NULL, + "value" jsonb NOT NULL +); +--> statement-breakpoint +CREATE TABLE "conditions"."contributor_receipt" ( + "id" text PRIMARY KEY NOT NULL, + "version" smallint NOT NULL, + "contributors" jsonb NOT NULL, + "provenance" jsonb, + "created_at" timestamp with time zone DEFAULT now() NOT NULL +); +--> statement-breakpoint +CREATE TABLE "conditions"."observation_latest" ( + "series_id" bigint PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY (sequence name "conditions"."observation_latest_series_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 9223372036854775807 START WITH 1 CACHE 1), + "effective_from" timestamp with time zone NOT NULL, + "since_at" timestamp with time zone NOT NULL, + "updated_at" timestamp with time zone DEFAULT now() NOT NULL, + "effective_until" timestamp with time zone, + "expires_at" timestamp with time zone, + "value_num" double precision, + "confidence_score" double precision, + "corroborations" integer DEFAULT 0 NOT NULL, + "retention_days" smallint, + "fused_public" boolean, + "subject_key" text NOT NULL, + "property" text NOT NULL, + "qualifier_key" text DEFAULT '' NOT NULL, + "source_id" text NOT NULL, + "subject_kind" text NOT NULL, + "access_mode" text NOT NULL, + "result_type" text NOT NULL, + "template_hash" text NOT NULL, + "feature_id" text, + "component_key" text, + "situation_id" text, + "crowd_record_id" text, + "contributor_receipt_id" text, + "value_money" numeric(14, 4), + "value_text" text, + "unit" text, + "currency" text, + "fused_from" text[], + "fused_sources" text[], + "evidence_state" text, + "geom" geometry(Geometry, 4326), + "reading" jsonb NOT NULL, + "template" jsonb NOT NULL, + CONSTRAINT "observation_latest_series_key" UNIQUE("subject_key","property","qualifier_key","source_id"), + CONSTRAINT "observation_latest_access_mode_check" CHECK ("access_mode" IN ('bulk', 'on_demand')), + CONSTRAINT "observation_latest_evidence_state_check" CHECK (evidence_state IS NULL OR "evidence_state" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')) +); +--> statement-breakpoint +CREATE TABLE "conditions"."observation_rollup_daily" ( + "series_id" bigint NOT NULL, + "day_utc" date NOT NULL, + "sample_count" integer NOT NULL, + "contributor_receipt_ids" text[], + "lineage_complete" boolean DEFAULT false NOT NULL, + "min" double precision NOT NULL, + "max" double precision NOT NULL, + "mean" double precision NOT NULL, + CONSTRAINT "observation_rollup_daily_pkey" PRIMARY KEY("series_id","day_utc") +); +--> statement-breakpoint +CREATE TABLE "conditions"."observation_rollup_hourly" ( + "series_id" bigint NOT NULL, + "hour_utc" timestamp with time zone NOT NULL, + "min" double precision NOT NULL, + "max" double precision NOT NULL, + "mean" double precision NOT NULL, + "sample_count" integer NOT NULL, + "lineage_complete" boolean DEFAULT false NOT NULL, + "contributor_receipt_ids" text[], + "bins" smallint[], + "counts" integer[], + CONSTRAINT "observation_rollup_hourly_pkey" PRIMARY KEY("series_id","hour_utc") +); +--> statement-breakpoint +CREATE TABLE "conditions"."observation_rollup_progress" ( + "period" text PRIMARY KEY NOT NULL, + "finalized_before" timestamp with time zone NOT NULL +); +--> statement-breakpoint +CREATE TABLE "conditions"."raw_payload" ( + "source_id" text NOT NULL, + "hash" text NOT NULL, + "url_key" text NOT NULL, + "fetch_id" bigint, + "media_type" text, + "bytes_raw" bigint NOT NULL, + "bytes_stored" bigint NOT NULL, + "first_fetched_at" timestamp with time zone NOT NULL, + "last_seen_at" timestamp with time zone NOT NULL, + "seen_count" integer DEFAULT 1 NOT NULL, + "tier" text NOT NULL, + "pinned_reason" text, + "storage_key" text NOT NULL, + "base_hash" text, + "evicted_at" timestamp with time zone, + CONSTRAINT "raw_payload_pkey" PRIMARY KEY("source_id","hash"), + CONSTRAINT "raw_payload_tier_check" CHECK ("tier" IN ('situation', 'observation', 'reference', 'hot')) +); +--> statement-breakpoint +CREATE TABLE "conditions"."feature" ( + "id" text PRIMARY KEY NOT NULL, + "record" jsonb NOT NULL, + "canonical_id" text NOT NULL, + "kind" text NOT NULL, + "type" text, + "subtype" text, + "domain" text NOT NULL, + "temporality" text NOT NULL, + "source_id" text NOT NULL, + "source_record_id" text NOT NULL, + "origin" text NOT NULL, + "access_mode" text NOT NULL, + "privacy_class" text NOT NULL, + "instance_id" text NOT NULL, + "revision" integer NOT NULL, + "recorded_at" timestamp with time zone NOT NULL, + "content_hash" text NOT NULL, + "fetched_at" timestamp with time zone NOT NULL, + "expires_at" timestamp with time zone, + "geom" geometry(Geometry, 4326), + "country" text, + "subdivision" text, + "tombstone_reason" text, + "tombstoned_at" timestamp with time zone, + "created_at" timestamp with time zone DEFAULT now() NOT NULL, + "lifecycle" text NOT NULL, + CONSTRAINT "feature_temporality_check" CHECK ("temporality" IN ('static', 'scheduled', 'live', 'forecast')), + CONSTRAINT "feature_origin_check" CHECK ("origin" IN ('feed', 'crowd', 'federation', 'derived')), + CONSTRAINT "feature_access_mode_check" CHECK ("access_mode" IN ('bulk', 'on_demand')), + CONSTRAINT "feature_privacy_class_check" CHECK ("privacy_class" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')), + CONSTRAINT "feature_tombstone_reason_check" CHECK (tombstone_reason IS NULL OR "tombstone_reason" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')), + CONSTRAINT "feature_tombstone_check" CHECK ((tombstone_reason IS NULL) = (tombstoned_at IS NULL)), + CONSTRAINT "feature_revision_check" CHECK (revision > 0), + CONSTRAINT "feature_lifecycle_check" CHECK ("lifecycle" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')) +); +--> statement-breakpoint +CREATE TABLE "conditions"."feature_canonical" ( + "canonical_feature_id" text PRIMARY KEY NOT NULL, + "survivor_id" text NOT NULL, + "member_ids" text[] NOT NULL, + "merged_sources" jsonb, + "components" jsonb DEFAULT '[]'::jsonb NOT NULL, + "computed_at" timestamp with time zone NOT NULL +); +--> statement-breakpoint +CREATE TABLE "conditions"."feature_component" ( + "feature_id" text NOT NULL, + "key" text NOT NULL, + "parent_key" text, + "kind" text NOT NULL, + "lifecycle" text, + "position" geometry(Point, 4326), + "external_ids" jsonb, + "details" jsonb NOT NULL, + "content_hash" text NOT NULL, + CONSTRAINT "feature_component_pkey" PRIMARY KEY("feature_id","key"), + CONSTRAINT "feature_component_lifecycle_check" CHECK (lifecycle IS NULL OR "lifecycle" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')) +); +--> statement-breakpoint +CREATE TABLE "conditions"."feature_link" ( + "a_id" text NOT NULL, + "b_id" text NOT NULL, + "method" text NOT NULL, + "confidence" double precision NOT NULL, + "status" text NOT NULL, + "decided_by" text, + "decided_at" timestamp with time zone NOT NULL, + CONSTRAINT "feature_link_pkey" PRIMARY KEY("a_id","b_id"), + CONSTRAINT "feature_link_order_check" CHECK ("conditions"."feature_link"."a_id" < "conditions"."feature_link"."b_id" COLLATE "C"), + CONSTRAINT "feature_link_method_check" CHECK ("method" IN ('external_id', 'spatial_attribute', 'manual')), + CONSTRAINT "feature_link_status_check" CHECK ("status" IN ('accepted', 'rejected', 'pending')) +); +--> statement-breakpoint +CREATE TABLE "conditions"."feature_revision" ( + "feature_id" text NOT NULL, + "revision" integer NOT NULL, + "recorded_at" timestamp with time zone NOT NULL, + "change_kinds" text[] NOT NULL, + "snapshot" jsonb NOT NULL, + CONSTRAINT "feature_revision_pkey" PRIMARY KEY("feature_id","revision") +); +--> statement-breakpoint +CREATE TABLE "conditions"."offer" ( + "id" text PRIMARY KEY NOT NULL, + "record" jsonb NOT NULL, + "canonical_id" text NOT NULL, + "kind" text NOT NULL, + "type" text, + "subtype" text, + "domain" text NOT NULL, + "temporality" text NOT NULL, + "source_id" text NOT NULL, + "source_record_id" text NOT NULL, + "origin" text NOT NULL, + "access_mode" text NOT NULL, + "privacy_class" text NOT NULL, + "instance_id" text NOT NULL, + "revision" integer NOT NULL, + "recorded_at" timestamp with time zone NOT NULL, + "content_hash" text NOT NULL, + "fetched_at" timestamp with time zone NOT NULL, + "expires_at" timestamp with time zone, + "geom" geometry(Geometry, 4326), + "country" text, + "subdivision" text, + "tombstone_reason" text, + "tombstoned_at" timestamp with time zone, + "created_at" timestamp with time zone DEFAULT now() NOT NULL, + "subject_class" text NOT NULL, + "subject_id" text NOT NULL, + "component_key" text, + "currency" text NOT NULL, + "valid_from" timestamp with time zone, + "valid_to" timestamp with time zone, + "min_price" numeric(14, 4), + "max_price" numeric(14, 4), + CONSTRAINT "offer_temporality_check" CHECK ("temporality" IN ('static', 'scheduled', 'live', 'forecast')), + CONSTRAINT "offer_origin_check" CHECK ("origin" IN ('feed', 'crowd', 'federation', 'derived')), + CONSTRAINT "offer_access_mode_check" CHECK ("access_mode" IN ('bulk', 'on_demand')), + CONSTRAINT "offer_privacy_class_check" CHECK ("privacy_class" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')), + CONSTRAINT "offer_tombstone_reason_check" CHECK (tombstone_reason IS NULL OR "tombstone_reason" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')), + CONSTRAINT "offer_tombstone_check" CHECK ((tombstone_reason IS NULL) = (tombstoned_at IS NULL)), + CONSTRAINT "offer_revision_check" CHECK (revision > 0), + CONSTRAINT "offer_subject_class_check" CHECK ("subject_class" IN ('feature', 'situation', 'observation', 'offer')) +); +--> statement-breakpoint +CREATE TABLE "conditions"."offer_revision" ( + "offer_id" text NOT NULL, + "revision" integer NOT NULL, + "recorded_at" timestamp with time zone NOT NULL, + "change_kinds" text[] NOT NULL, + "snapshot" jsonb NOT NULL, + CONSTRAINT "offer_revision_pkey" PRIMARY KEY("offer_id","revision") +); +--> statement-breakpoint +CREATE TABLE "conditions"."record_relation" ( + "from_class" text NOT NULL, + "from_id" text NOT NULL, + "relation" text NOT NULL, + "to_class" text NOT NULL, + "to_id" text NOT NULL, + "component_key" text DEFAULT '' NOT NULL, + CONSTRAINT "record_relation_pkey" PRIMARY KEY("from_class","from_id","relation","to_class","to_id","component_key"), + CONSTRAINT "record_relation_from_class_check" CHECK ("from_class" IN ('feature', 'situation', 'observation', 'offer')), + CONSTRAINT "record_relation_to_class_check" CHECK ("to_class" IN ('feature', 'situation', 'observation', 'offer')), + CONSTRAINT "record_relation_relation_check" CHECK ("relation" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')) +); +--> statement-breakpoint +CREATE TABLE "conditions"."situation" ( + "id" text PRIMARY KEY NOT NULL, + "record" jsonb NOT NULL, + "canonical_id" text NOT NULL, + "kind" text NOT NULL, + "type" text, + "subtype" text, + "domain" text NOT NULL, + "temporality" text NOT NULL, + "source_id" text NOT NULL, + "source_record_id" text NOT NULL, + "origin" text NOT NULL, + "access_mode" text NOT NULL, + "privacy_class" text NOT NULL, + "instance_id" text NOT NULL, + "revision" integer NOT NULL, + "recorded_at" timestamp with time zone NOT NULL, + "content_hash" text NOT NULL, + "fetched_at" timestamp with time zone NOT NULL, + "expires_at" timestamp with time zone, + "geom" geometry(Geometry, 4326), + "country" text, + "subdivision" text, + "tombstone_reason" text, + "tombstoned_at" timestamp with time zone, + "created_at" timestamp with time zone DEFAULT now() NOT NULL, + "severity" text NOT NULL, + "severity_level" smallint, + "certainty" text NOT NULL, + "planned" boolean NOT NULL, + "validity_status" text NOT NULL, + "valid_from" timestamp with time zone, + "valid_to" timestamp with time zone, + "group_id" text, + "evidence_state" text, + "confidence_score" double precision, + "routing_eligible" boolean DEFAULT false NOT NULL, + "corroborations" integer DEFAULT 0 NOT NULL, + "flagged_at" timestamp with time zone, + CONSTRAINT "situation_temporality_check" CHECK ("temporality" IN ('static', 'scheduled', 'live', 'forecast')), + CONSTRAINT "situation_origin_check" CHECK ("origin" IN ('feed', 'crowd', 'federation', 'derived')), + CONSTRAINT "situation_access_mode_check" CHECK ("access_mode" IN ('bulk', 'on_demand')), + CONSTRAINT "situation_privacy_class_check" CHECK ("privacy_class" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')), + CONSTRAINT "situation_tombstone_reason_check" CHECK (tombstone_reason IS NULL OR "tombstone_reason" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')), + CONSTRAINT "situation_tombstone_check" CHECK ((tombstone_reason IS NULL) = (tombstoned_at IS NULL)), + CONSTRAINT "situation_revision_check" CHECK (revision > 0), + CONSTRAINT "situation_severity_check" CHECK ("severity" IN ('none', 'minor', 'moderate', 'major', 'critical', 'unknown')), + CONSTRAINT "situation_severity_level_check" CHECK ("conditions"."situation"."severity_level" IS NULL OR "conditions"."situation"."severity_level" BETWEEN 1 AND 5), + CONSTRAINT "situation_certainty_check" CHECK ("certainty" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')), + CONSTRAINT "situation_validity_status_check" CHECK ("validity_status" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')), + CONSTRAINT "situation_evidence_state_check" CHECK (evidence_state IS NULL OR "evidence_state" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')) +); +--> statement-breakpoint +CREATE TABLE "conditions"."situation_effect" ( + "situation_id" text NOT NULL, + "effect_id" text NOT NULL, + "phase_id" text DEFAULT '' NOT NULL, + "kind" text NOT NULL, + "applicability_kind" text NOT NULL, + "normalization" text NOT NULL, + "compliance" text NOT NULL, + "direction" text, + "valid_from" timestamp with time zone, + "valid_to" timestamp with time zone, + "geom" geometry(Geometry, 4326), + "value" jsonb NOT NULL, + CONSTRAINT "situation_effect_pkey" PRIMARY KEY("situation_id","effect_id"), + CONSTRAINT "situation_effect_applicability_kind_check" CHECK ("applicability_kind" IN ('all', 'classes', 'unknown')), + CONSTRAINT "situation_effect_normalization_check" CHECK ("normalization" IN ('complete', 'partial', 'unsupported')), + CONSTRAINT "situation_effect_compliance_check" CHECK ("compliance" IN ('mandatory', 'advisory', 'unknown')) +); +--> statement-breakpoint +CREATE TABLE "conditions"."situation_revision" ( + "situation_id" text NOT NULL, + "revision" integer NOT NULL, + "recorded_at" timestamp with time zone NOT NULL, + "change_kinds" text[] NOT NULL, + "snapshot" jsonb NOT NULL, + CONSTRAINT "situation_revision_pkey" PRIMARY KEY("situation_id","revision") +); +--> statement-breakpoint +CREATE TABLE "conditions"."archive_erasure" ( + "key" text PRIMARY KEY NOT NULL, + "applied_at" timestamp with time zone DEFAULT now() NOT NULL +); +--> statement-breakpoint +CREATE TABLE "conditions"."archive_file" ( + "record_class" text PRIMARY KEY NOT NULL, + "file_name" text NOT NULL, + "sha256" text NOT NULL, + "bytes" bigint NOT NULL, + "built_at" timestamp with time zone NOT NULL +); +--> statement-breakpoint +CREATE TABLE "conditions"."block_list" ( + "key_id" text PRIMARY KEY NOT NULL, + "reason" text, + "created_at" timestamp with time zone NOT NULL, + "created_by" text NOT NULL +); +--> statement-breakpoint +CREATE TABLE "conditions"."federation_blocklist" ( + "peer_id" text PRIMARY KEY NOT NULL, + "reason" text, + "created_at" timestamp with time zone DEFAULT now() NOT NULL, + "created_by" text NOT NULL +); +--> statement-breakpoint +CREATE TABLE "conditions"."federation_instance_key" ( + "key_id" text PRIMARY KEY NOT NULL, + "public_key" "bytea" NOT NULL, + "private_key_ciphertext" "bytea" NOT NULL, + "private_key_iv" "bytea" NOT NULL, + "private_key_tag" "bytea" NOT NULL, + "multibase" text NOT NULL, + "not_before" timestamp with time zone NOT NULL, + "not_after" timestamp with time zone NOT NULL, + "created_at" timestamp with time zone NOT NULL, + "endorsed_by" text, + "endorsement" "bytea", + "endorsement_proof" "bytea", + CONSTRAINT "federation_instance_key_private_key_check" CHECK (("private_key_ciphertext" IS NULL) = ("private_key_iv" IS NULL) AND ("private_key_iv" IS NULL) = ("private_key_tag" IS NULL) AND octet_length("private_key_iv") = 12 AND octet_length("private_key_tag") = 16) +); +--> statement-breakpoint +CREATE TABLE "conditions"."federation_journal" ( + "singleton" boolean PRIMARY KEY DEFAULT true NOT NULL, + "epoch" uuid NOT NULL, + "started_at" timestamp with time zone NOT NULL, + "seen_xid" "xid8" NOT NULL, + "timeline_id" integer, + "database_oid" bigint, + "system_identifier" bigint, + CONSTRAINT "federation_journal_singleton_check" CHECK ("conditions"."federation_journal"."singleton") +); +--> statement-breakpoint +CREATE TABLE "conditions"."federation_lapsed_copy" ( + "record_class" text NOT NULL, + "record_id" text NOT NULL, + "peer_instance_id" text NOT NULL, + "source_id" text NOT NULL, + "revision" integer NOT NULL, + "lapsed_at" timestamp with time zone NOT NULL, + CONSTRAINT "federation_lapsed_copy_pkey" PRIMARY KEY("record_class","record_id") +); +--> statement-breakpoint +CREATE TABLE "conditions"."federation_outbox" ( + "seq" bigint PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY (sequence name "conditions"."federation_outbox_seq_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 9223372036854775807 START WITH 1 CACHE 1), + "operation" text NOT NULL, + "record_class" text NOT NULL, + "record_id" text NOT NULL, + "canonical_id" text, + "kind" text NOT NULL, + "domain" text NOT NULL, + "property" text, + "priority" boolean DEFAULT false NOT NULL, + "snapshot" jsonb, + "tombstone_reason" text, + "revision" integer, + "created_at" timestamp with time zone DEFAULT now() NOT NULL, + "txid" "xid8" DEFAULT pg_current_xact_id() NOT NULL, + CONSTRAINT "federation_outbox_operation_check" CHECK ("conditions"."federation_outbox"."operation" IN ('create','update','delete','liveness')), + CONSTRAINT "federation_outbox_record_class_check" CHECK ("record_class" IN ('feature', 'situation', 'observation', 'offer')), + CONSTRAINT "federation_outbox_delete_shape_check" CHECK (("conditions"."federation_outbox"."operation" = 'delete') = ("conditions"."federation_outbox"."snapshot" IS NULL AND "conditions"."federation_outbox"."tombstone_reason" IS NOT NULL)) +); +--> statement-breakpoint +CREATE TABLE "conditions"."federation_peer_capabilities" ( + "peer_instance_id" text PRIMARY KEY NOT NULL, + "schema_versions" text[] NOT NULL, + "fetched_at" timestamp with time zone NOT NULL, + "protocol_version" text +); +--> statement-breakpoint +CREATE TABLE "conditions"."federation_peer_cursor" ( + "peer_instance_id" text PRIMARY KEY NOT NULL, + "cursor" text DEFAULT '0.0' NOT NULL, + "updated_at" timestamp with time zone NOT NULL, + "archive_built_at" timestamp with time zone, + "archive_landed_at" timestamp with time zone, + "journal_epoch" text, + "cursor_reset_at" timestamp with time zone, + "reconcile_due_since" timestamp with time zone, + "reconcile_class" text, + "reconcile_after" text, + "reconciled_at" timestamp with time zone +); +--> statement-breakpoint +CREATE TABLE "conditions"."federation_peer_health" ( + "peer_id" text PRIMARY KEY NOT NULL, + "availability_ok" integer DEFAULT 0 NOT NULL, + "availability_fail" integer DEFAULT 0 NOT NULL, + "signature_failures" integer DEFAULT 0 NOT NULL, + "replay_failures" integer DEFAULT 0 NOT NULL, + "schema_failures" integer DEFAULT 0 NOT NULL, + "rate_violations" integer DEFAULT 0 NOT NULL, + "effective_tier_until" timestamp with time zone, + "updated_at" timestamp with time zone DEFAULT now() NOT NULL +); +--> statement-breakpoint +CREATE TABLE "conditions"."federation_peer_key" ( + "peer_instance_id" text NOT NULL, + "key_id" text NOT NULL, + "anchor" text NOT NULL, + "learned_at" timestamp with time zone NOT NULL, + CONSTRAINT "federation_peer_key_pkey" PRIMARY KEY("peer_instance_id","key_id") +); +--> statement-breakpoint +CREATE TABLE "conditions"."federation_source_receipt" ( + "peer_instance_id" text NOT NULL, + "source_id" text NOT NULL, + "last_received_at" timestamp with time zone NOT NULL, + "liveness_at" timestamp with time zone, + "cadence_sec" integer, + CONSTRAINT "federation_source_receipt_pkey" PRIMARY KEY("peer_instance_id","source_id") +); +--> statement-breakpoint +CREATE TABLE "conditions"."federation_subscription" ( + "id" text PRIMARY KEY NOT NULL, + "peer_id" text NOT NULL, + "filter" jsonb DEFAULT '{}'::jsonb NOT NULL, + "delivery_mode" text DEFAULT 'pull' NOT NULL, + "inbox_url" text, + "cursor" text DEFAULT '0.0' NOT NULL, + "priority_only" boolean DEFAULT true NOT NULL, + "push_failures" integer DEFAULT 0 NOT NULL, + "revision" integer DEFAULT 0 NOT NULL, + "status" text DEFAULT 'active' NOT NULL, + "created_at" timestamp with time zone NOT NULL, + "updated_at" timestamp with time zone NOT NULL, + "expires_at" timestamp with time zone DEFAULT now() + interval '30 days' NOT NULL, + CONSTRAINT "federation_subscription_delivery_mode_check" CHECK ("conditions"."federation_subscription"."delivery_mode" IN ('pull','webhook','sse')), + CONSTRAINT "federation_subscription_status_check" CHECK ("conditions"."federation_subscription"."status" IN ('active','push_disabled')) +); +--> statement-breakpoint +CREATE TABLE "conditions"."federation_tombstone" ( + "canonical_id" text NOT NULL, + "peer_instance_id" text DEFAULT '' NOT NULL, + "reason" text NOT NULL, + "tombstoned_at" timestamp with time zone DEFAULT now() NOT NULL, + "expires_at" timestamp with time zone NOT NULL, + CONSTRAINT "federation_tombstone_pkey" PRIMARY KEY("canonical_id","peer_instance_id"), + CONSTRAINT "federation_tombstone_reason_check" CHECK ("reason" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')) +); +--> statement-breakpoint +CREATE TABLE "conditions"."geonet_coverage" ( + "revisions" jsonb DEFAULT '{}'::jsonb NOT NULL, + "source_id" text PRIMARY KEY NOT NULL, + "covered_from" timestamp with time zone NOT NULL, + "covered_until" timestamp with time zone NOT NULL, + CONSTRAINT "geonet_coverage_order_check" CHECK ("conditions"."geonet_coverage"."covered_from" < "conditions"."geonet_coverage"."covered_until") +); +--> statement-breakpoint +CREATE TABLE "conditions"."issuer_key" ( + "key_id" text PRIMARY KEY NOT NULL, + "public_key" "bytea" NOT NULL, + "private_key_ciphertext" "bytea" NOT NULL, + "private_key_iv" "bytea" NOT NULL, + "private_key_tag" "bytea" NOT NULL, + "not_before" timestamp with time zone NOT NULL, + "not_after" timestamp with time zone NOT NULL, + CONSTRAINT "issuer_key_private_key_check" CHECK (("private_key_ciphertext" IS NULL) = ("private_key_iv" IS NULL) AND ("private_key_iv" IS NULL) = ("private_key_tag" IS NULL) AND octet_length("private_key_iv") = 12 AND octet_length("private_key_tag") = 16) +); +--> statement-breakpoint +CREATE TABLE "conditions"."nsw_rfs_clock" ( + "source_id" text NOT NULL, + "incident_id" text NOT NULL, + "sent" text NOT NULL, + "published" text NOT NULL, + "content" text NOT NULL, + "expiry" text NOT NULL, + CONSTRAINT "nsw_rfs_clock_pkey" PRIMARY KEY("source_id","incident_id") +); +--> statement-breakpoint +CREATE TABLE "conditions"."observation_revision" ( + "source_id" text NOT NULL, + "feature_id" text NOT NULL, + "property" text NOT NULL, + "measured_at" timestamp with time zone NOT NULL, + "rank" text NOT NULL, + "signature" text NOT NULL, + "suppressed" boolean NOT NULL, + CONSTRAINT "observation_revision_pkey" PRIMARY KEY("source_id","feature_id","property") +); +--> statement-breakpoint +CREATE TABLE "conditions"."on_demand_fetch" ( + "source_id" text NOT NULL, + "cell" text NOT NULL, + "fetched_at" timestamp with time zone, + "expires_at" timestamp with time zone, + "status" text NOT NULL, + "retry_at" timestamp with time zone, + "claimed_until" timestamp with time zone, + CONSTRAINT "on_demand_fetch_pkey" PRIMARY KEY("source_id","cell"), + CONSTRAINT "on_demand_fetch_status_check" CHECK ("conditions"."on_demand_fetch"."status" IN ('pending','fresh','failed')) +); +--> statement-breakpoint +CREATE TABLE "conditions"."on_demand_quota" ( + "source_id" text PRIMARY KEY NOT NULL, + "tokens" real NOT NULL, + "refilled_at" timestamp with time zone NOT NULL, + "day" date NOT NULL, + "day_count" integer NOT NULL +); +--> statement-breakpoint +CREATE TABLE "conditions"."osm_road" ( + "way_id" bigint PRIMARY KEY NOT NULL, + "geom" geometry(Geometry, 4326) NOT NULL, + "highway" text NOT NULL, + "oneway" boolean DEFAULT false NOT NULL, + "oneway_reversed" boolean DEFAULT false NOT NULL, + "ref" text, + "name" text, + "maxspeed_kph" double precision, + "region" text NOT NULL, + "import_config_hash" text, + "import_provenance" jsonb, + "imported_at" timestamp with time zone NOT NULL +); +--> statement-breakpoint +CREATE TABLE "conditions"."public_license_policy" ( + "license" text PRIMARY KEY NOT NULL +); +--> statement-breakpoint +CREATE TABLE "conditions"."reporter" ( + "key_id" text PRIMARY KEY NOT NULL, + "pub_jwk" jsonb NOT NULL, + "reputation_alpha" double precision NOT NULL, + "reputation_beta" double precision NOT NULL, + "corroborated_count" integer DEFAULT 0 NOT NULL, + "trust_signal" double precision, + "entitlement_expires_at" timestamp with time zone NOT NULL, + "status" text DEFAULT 'active' NOT NULL, + "created_at" timestamp with time zone NOT NULL, + "last_active_at" timestamp with time zone NOT NULL, + CONSTRAINT "reporter_reputation_alpha_check" CHECK ("conditions"."reporter"."reputation_alpha" > 0), + CONSTRAINT "reporter_reputation_beta_check" CHECK ("conditions"."reporter"."reputation_beta" > 0), + CONSTRAINT "reporter_status_check" CHECK ("conditions"."reporter"."status" IN ('active','blocked')) +); +--> statement-breakpoint +CREATE TABLE "conditions"."road_graph_state" ( + "singleton" boolean PRIMARY KEY DEFAULT true NOT NULL, + "generation" text NOT NULL, + "status" text DEFAULT 'ready' NOT NULL, + "regions" jsonb NOT NULL, + "highway_classes" jsonb NOT NULL, + "pbf_provenance" jsonb NOT NULL, + "imported_at" timestamp with time zone NOT NULL, + "activated_at" timestamp with time zone NOT NULL, + CONSTRAINT "road_graph_state_singleton_check" CHECK ("conditions"."road_graph_state"."singleton" IS TRUE) +); +--> statement-breakpoint +CREATE TABLE "conditions"."road_segment" ( + "segment_id" text PRIMARY KEY NOT NULL, + "way_id" bigint NOT NULL, + "dir" text NOT NULL, + "geom" geometry(Geometry, 4326) NOT NULL, + "highway" text NOT NULL, + "ref" text, + "length_m" double precision NOT NULL, + "min_zoom" smallint NOT NULL, + "free_flow_kph" double precision, + "openlr" text, + "computed_at" timestamp with time zone NOT NULL +); +--> statement-breakpoint +CREATE TABLE "conditions"."secrets_key_check" ( + "id" smallint PRIMARY KEY DEFAULT 1 NOT NULL, + "value_ciphertext" "bytea" NOT NULL, + "value_iv" "bytea" NOT NULL, + "value_tag" "bytea" NOT NULL, + "created_at" timestamp with time zone DEFAULT now() NOT NULL, + CONSTRAINT "secrets_key_check_id_check" CHECK ("conditions"."secrets_key_check"."id" = 1), + CONSTRAINT "secrets_key_check_value_check" CHECK (("value_ciphertext" IS NULL) = ("value_iv" IS NULL) AND ("value_iv" IS NULL) = ("value_tag" IS NULL) AND octet_length("value_iv") = 12 AND octet_length("value_tag") = 16) +); +--> statement-breakpoint +CREATE TABLE "conditions"."segment_observation" ( + "segment_id" text NOT NULL, + "source" text NOT NULL, + "source_tier" text NOT NULL, + "current_kph" double precision, + "free_flow_kph" double precision, + "speed_ratio" double precision, + "los" text NOT NULL, + "confidence_score" double precision NOT NULL, + "sample_count" integer, + "native_field_sources" jsonb, + "field_sources" jsonb, + "field_contributors" jsonb, + "field_lineage_complete" jsonb, + "permission_licenses" text[], + "observed_at" timestamp with time zone NOT NULL, + "expires_at" timestamp with time zone, + CONSTRAINT "segment_observation_pkey" PRIMARY KEY("segment_id","source"), + CONSTRAINT "segment_observation_los_check" CHECK ("los" IN ('free_flow', 'heavy', 'queuing', 'stationary', 'blocked', 'unknown')) +); +--> statement-breakpoint +CREATE TABLE "conditions"."segment_profile" ( + "segment_id" text NOT NULL, + "dow" smallint NOT NULL, + "tod_hour" smallint NOT NULL, + "speed_kph" double precision NOT NULL, + "sample_count" integer NOT NULL, + "contributor_receipt_ids" text[], + "lineage_complete" boolean DEFAULT false NOT NULL, + "permission_licenses" text[], + "contributing" text[] DEFAULT '{}'::text[] NOT NULL, + "computed_at" timestamp with time zone NOT NULL, + CONSTRAINT "segment_profile_pkey" PRIMARY KEY("segment_id","dow","tod_hour") +); +--> statement-breakpoint +CREATE TABLE "conditions"."segment_speed" ( + "segment_id" text PRIMARY KEY NOT NULL, + "current_kph" double precision, + "free_flow_kph" double precision, + "speed_ratio" double precision, + "los" text NOT NULL, + "confidence" text NOT NULL, + "source_tier" text, + "contributing" text[], + "is_estimated" boolean DEFAULT false NOT NULL, + "native_field_sources" jsonb, + "field_sources" jsonb, + "field_contributors" jsonb, + "field_lineage_complete" jsonb, + "permission_licenses" text[], + "observed_at" timestamp with time zone, + "updated_at" timestamp with time zone NOT NULL, + CONSTRAINT "segment_speed_los_check" CHECK ("los" IN ('free_flow', 'heavy', 'queuing', 'stationary', 'blocked', 'unknown')), + CONSTRAINT "segment_speed_confidence_check" CHECK ("confidence" IN ('measured', 'estimated')) +); +--> statement-breakpoint +CREATE TABLE "conditions"."sensor_baseline" ( + "subject_key" text NOT NULL, + "source" text NOT NULL, + "dow_bucket" smallint NOT NULL, + "tod_bucket" smallint NOT NULL, + "free_flow_kph" double precision NOT NULL, + "method" text NOT NULL, + "contributor_receipt_ids" text[], + "lineage_complete" boolean DEFAULT false NOT NULL, + "permission_licenses" text[], + "contributing" text[], + "sample_count" integer NOT NULL, + "computed_at" timestamp with time zone NOT NULL, + CONSTRAINT "sensor_baseline_pkey" PRIMARY KEY("subject_key","dow_bucket","tod_bucket","method") +); +--> statement-breakpoint +CREATE TABLE "conditions"."sensor_segment" ( + "subject_key" text PRIMARY KEY NOT NULL, + "segment_id" text NOT NULL, + "fraction" double precision NOT NULL, + "offset_m" double precision NOT NULL, + "bearing_deg" double precision, + "matched_at" timestamp with time zone NOT NULL +); +--> statement-breakpoint +CREATE TABLE "conditions"."smn_cap_decision" ( + "source_id" text PRIMARY KEY NOT NULL, + "decided_at" timestamp with time zone NOT NULL, + "decision" jsonb NOT NULL +); +--> statement-breakpoint +CREATE TABLE "conditions"."smn_cap_message" ( + "source_id" text NOT NULL, + "identifier" text NOT NULL, + "variant" text GENERATED ALWAYS AS (encode(sha256(body), 'hex')) STORED NOT NULL, + "retrieval" jsonb NOT NULL, + "body" "bytea" NOT NULL, + "retain_until" timestamp with time zone NOT NULL, + CONSTRAINT "smn_cap_message_pkey" PRIMARY KEY("source_id","variant") +); +--> statement-breakpoint +CREATE TABLE "conditions"."source_poll_attempt" ( + "id" bigint PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY (sequence name "conditions"."source_poll_attempt_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 9223372036854775807 START WITH 1 CACHE 1), + "source" text NOT NULL, + "attempted_at" timestamp with time zone NOT NULL, + "finished_at" timestamp with time zone, + "outcome" text NOT NULL, + "network_validated" boolean NOT NULL, + "published" boolean DEFAULT false NOT NULL, + "active_event_count" integer, + "inserted" integer, + "updated" integer, + "deleted" integer, + "rejected" integer, + "duration_ms" integer, + "partitions_succeeded" integer, + "partitions_failed" integer, + "partitions_total" integer, + "error" text, + "payload_hashes" text[] +); +--> statement-breakpoint +CREATE TABLE "conditions"."source_shrink" ( + "source_id" text NOT NULL, + "scope" text NOT NULL, + "since" timestamp with time zone NOT NULL, + "polls" integer NOT NULL, + "stated" integer NOT NULL, + "held" integer NOT NULL, + CONSTRAINT "source_shrink_pkey" PRIMARY KEY("source_id","scope"), + CONSTRAINT "source_shrink_scope_check" CHECK ("conditions"."source_shrink"."scope" IN ('series','records')) +); +--> statement-breakpoint +CREATE TABLE "conditions"."source_status" ( + "source" text PRIMARY KEY NOT NULL, + "last_attempt_at" timestamp with time zone, + "last_success_at" timestamp with time zone, + "last_network_success_at" timestamp with time zone, + "freshness_deadline" timestamp with time zone, + "source_published_at" timestamp with time zone, + "last_publication_at" timestamp with time zone, + "publication_revision" bigint DEFAULT 0 NOT NULL, + "last_outcome" text, + "freshness_window_sec" integer NOT NULL, + "last_row_count" integer, + "active_event_count" integer, + "last_inserted" integer, + "last_updated" integer, + "last_deleted" integer, + "last_rejected" integer, + "last_duration_ms" integer, + "consecutive_failures" integer DEFAULT 0 NOT NULL, + "last_error" text, + "last_error_at" timestamp with time zone, + "raw_hot_evicted_at" timestamp with time zone, + "updated_at" timestamp with time zone DEFAULT now() NOT NULL +); +--> statement-breakpoint +CREATE TABLE "conditions"."spent_token" ( + "token_hash" text PRIMARY KEY NOT NULL, + "purpose" text NOT NULL, + "spent_at" timestamp with time zone NOT NULL, + "expires_at" timestamp with time zone NOT NULL +); +--> statement-breakpoint +CREATE TABLE "conditions"."token_quota" ( + "key_id" text NOT NULL, + "epoch" text NOT NULL, + "issued" integer DEFAULT 0 NOT NULL, + CONSTRAINT "token_quota_pkey" PRIMARY KEY("key_id","epoch") +); +--> statement-breakpoint +CREATE TABLE "conditions"."oauth_grant" ( + "grant_key" text PRIMARY KEY NOT NULL, + "refresh_token_ciphertext" "bytea" NOT NULL, + "refresh_token_iv" "bytea" NOT NULL, + "refresh_token_tag" "bytea" NOT NULL, + "refresh_issued_at" timestamp with time zone NOT NULL, + "access_token_ciphertext" "bytea", + "access_token_iv" "bytea", + "access_token_tag" "bytea", + "access_expires_at" timestamp with time zone, + "rejected_at" timestamp with time zone, + "last_error" text, + "last_error_at" timestamp with time zone, + "updated_at" timestamp with time zone DEFAULT now() NOT NULL, + CONSTRAINT "oauth_grant_refresh_token_check" CHECK (("refresh_token_ciphertext" IS NULL) = ("refresh_token_iv" IS NULL) AND ("refresh_token_iv" IS NULL) = ("refresh_token_tag" IS NULL) AND octet_length("refresh_token_iv") = 12 AND octet_length("refresh_token_tag") = 16), + CONSTRAINT "oauth_grant_access_token_check" CHECK (("access_token_ciphertext" IS NULL) = ("access_token_iv" IS NULL) AND ("access_token_iv" IS NULL) = ("access_token_tag" IS NULL) AND octet_length("access_token_iv") = 12 AND octet_length("access_token_tag") = 16) +); +--> statement-breakpoint +CREATE TABLE "conditions"."source" ( + "id" text PRIMARY KEY NOT NULL, + "domain" text NOT NULL, + "format" text NOT NULL, + "product" text NOT NULL, + "access_mode" text NOT NULL, + "tier" text NOT NULL, + "country" text, + "subdivision" text, + "operator" text NOT NULL, + "license" text NOT NULL, + "license_url" text, + "attribution" text NOT NULL, + "credit_name" text, + "credit_url" text, + "credit_notice" text, + "rights" jsonb, + "restricted" boolean DEFAULT false NOT NULL, + "restricted_since" timestamp with time zone, + "fusion_restricted" boolean, + "fusion_tier" text, + "fusion_licenses" text, + "federation_restricted" boolean, + "federation_pending" boolean DEFAULT false NOT NULL, + "cadence_sec" integer NOT NULL, + "freshness_window_sec" integer NOT NULL, + "raw_retention" text, + "extras_allow" text[] DEFAULT '{}'::text[] NOT NULL, + "extras_federate" boolean DEFAULT false NOT NULL, + "lane_numbering" text, + "parent_source_id" text, + "policy_ids" text[], + "selection_state" text, + "active" boolean DEFAULT true NOT NULL, + "updated_at" timestamp with time zone DEFAULT now() NOT NULL, + CONSTRAINT "source_access_mode_check" CHECK ("access_mode" IN ('bulk', 'on_demand')), + CONSTRAINT "source_tier_check" CHECK ("tier" IN ('authoritative', 'operator', 'aggregator', 'community')) +); +--> statement-breakpoint +ALTER TABLE "conditions"."report_evidence" ADD CONSTRAINT "report_evidence_actor_key_id_fkey" FOREIGN KEY ("actor_key_id") REFERENCES "conditions"."reporter"("key_id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "conditions"."report_refusal" ADD CONSTRAINT "report_refusal_actor_key_id_fkey" FOREIGN KEY ("actor_key_id") REFERENCES "conditions"."reporter"("key_id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "conditions"."sub_claim" ADD CONSTRAINT "sub_claim_key_id_fkey" FOREIGN KEY ("key_id") REFERENCES "conditions"."reporter"("key_id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "conditions"."observation_rollup_daily" ADD CONSTRAINT "observation_rollup_daily_series_id_fkey" FOREIGN KEY ("series_id") REFERENCES "conditions"."observation_latest"("series_id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "conditions"."observation_rollup_hourly" ADD CONSTRAINT "observation_rollup_hourly_series_id_fkey" FOREIGN KEY ("series_id") REFERENCES "conditions"."observation_latest"("series_id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "conditions"."feature_component" ADD CONSTRAINT "feature_component_feature_id_fkey" FOREIGN KEY ("feature_id") REFERENCES "conditions"."feature"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "conditions"."feature_revision" ADD CONSTRAINT "feature_revision_feature_id_fkey" FOREIGN KEY ("feature_id") REFERENCES "conditions"."feature"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "conditions"."offer_revision" ADD CONSTRAINT "offer_revision_offer_id_fkey" FOREIGN KEY ("offer_id") REFERENCES "conditions"."offer"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "conditions"."situation_effect" ADD CONSTRAINT "situation_effect_situation_id_fkey" FOREIGN KEY ("situation_id") REFERENCES "conditions"."situation"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "conditions"."situation_revision" ADD CONSTRAINT "situation_revision_situation_id_fkey" FOREIGN KEY ("situation_id") REFERENCES "conditions"."situation"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "conditions"."token_quota" ADD CONSTRAINT "token_quota_key_id_fkey" FOREIGN KEY ("key_id") REFERENCES "conditions"."reporter"("key_id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint +CREATE INDEX "binding_queue_next_attempt_at_idx" ON "conditions"."binding_queue" USING btree ("next_attempt_at");--> statement-breakpoint +CREATE INDEX "record_binding_status_idx" ON "conditions"."record_binding" USING btree ("status");--> statement-breakpoint +CREATE INDEX "record_segment_segment_id_idx" ON "conditions"."record_segment" USING btree ("segment_id");--> statement-breakpoint +CREATE INDEX "report_evidence_record_class_record_id_occurred_at_idx" ON "conditions"."report_evidence" USING btree ("record_class","record_id","occurred_at");--> statement-breakpoint +CREATE INDEX "report_evidence_actor_key_id_occurred_at_idx" ON "conditions"."report_evidence" USING btree ("actor_key_id","occurred_at");--> statement-breakpoint +CREATE INDEX "report_evidence_merged_idx" ON "conditions"."report_evidence" USING btree (("details" ->> 'merged')) WHERE "conditions"."report_evidence"."details" ? 'merged';--> statement-breakpoint +CREATE INDEX "report_refusal_actor_key_id_occurred_at_idx" ON "conditions"."report_refusal" USING btree ("actor_key_id","occurred_at");--> statement-breakpoint +CREATE INDEX "report_refusal_occurred_at_idx" ON "conditions"."report_refusal" USING btree ("occurred_at");--> statement-breakpoint +CREATE INDEX "sub_claim_key_id_idx" ON "conditions"."sub_claim" USING btree ("key_id");--> statement-breakpoint +CREATE INDEX "observation_latest_geom_idx" ON "conditions"."observation_latest" USING gist ("geom");--> statement-breakpoint +CREATE INDEX "observation_latest_property_value_text_idx" ON "conditions"."observation_latest" USING btree ("property","value_text");--> statement-breakpoint +CREATE INDEX "observation_latest_source_id_series_id_idx" ON "conditions"."observation_latest" USING btree ("source_id","series_id");--> statement-breakpoint +CREATE INDEX "observation_latest_feature_id_component_key_idx" ON "conditions"."observation_latest" USING btree ("feature_id","component_key");--> statement-breakpoint +CREATE INDEX "observation_latest_value_money_fuel_price_idx" ON "conditions"."observation_latest" USING btree ("value_money") WHERE "conditions"."observation_latest"."property" = 'fuel.price';--> statement-breakpoint +CREATE INDEX "observation_latest_expires_at_idx" ON "conditions"."observation_latest" USING btree ("expires_at") WHERE "conditions"."observation_latest"."expires_at" IS NOT NULL;--> statement-breakpoint +CREATE INDEX "observation_latest_effective_from_idx" ON "conditions"."observation_latest" USING brin ("effective_from");--> statement-breakpoint +CREATE INDEX "observation_latest_crowd_record_id_idx" ON "conditions"."observation_latest" USING btree ("crowd_record_id") WHERE "conditions"."observation_latest"."crowd_record_id" IS NOT NULL;--> statement-breakpoint +CREATE INDEX "observation_rollup_daily_day_utc_idx" ON "conditions"."observation_rollup_daily" USING btree ("day_utc");--> statement-breakpoint +CREATE INDEX "observation_rollup_hourly_hour_utc_idx" ON "conditions"."observation_rollup_hourly" USING btree ("hour_utc");--> statement-breakpoint +CREATE INDEX "raw_payload_source_id_first_fetched_at_idx" ON "conditions"."raw_payload" USING btree ("source_id","first_fetched_at");--> statement-breakpoint +CREATE INDEX "raw_payload_tier_last_seen_at_idx" ON "conditions"."raw_payload" USING btree ("tier","last_seen_at") WHERE "conditions"."raw_payload"."evicted_at" IS NULL;--> statement-breakpoint +CREATE INDEX "raw_payload_source_id_base_hash_idx" ON "conditions"."raw_payload" USING btree ("source_id","base_hash") WHERE "conditions"."raw_payload"."base_hash" IS NOT NULL;--> statement-breakpoint +CREATE INDEX "feature_geom_idx" ON "conditions"."feature" USING gist ("geom");--> statement-breakpoint +CREATE INDEX "feature_kind_type_idx" ON "conditions"."feature" USING btree ("kind","type");--> statement-breakpoint +CREATE INDEX "feature_source_id_id_idx" ON "conditions"."feature" USING btree ("source_id","id");--> statement-breakpoint +CREATE INDEX "feature_canonical_id_idx" ON "conditions"."feature" USING btree ("canonical_id");--> statement-breakpoint +CREATE INDEX "feature_kind_lifecycle_idx" ON "conditions"."feature" USING btree ("kind","lifecycle");--> statement-breakpoint +CREATE INDEX "feature_expires_at_idx" ON "conditions"."feature" USING btree ("expires_at") WHERE "conditions"."feature"."tombstoned_at" IS NULL;--> statement-breakpoint +CREATE INDEX "feature_tombstoned_at_idx" ON "conditions"."feature" USING btree ("tombstoned_at") WHERE "conditions"."feature"."tombstoned_at" IS NOT NULL;--> statement-breakpoint +CREATE INDEX "feature_external_ids_idx" ON "conditions"."feature" USING gin (("record" -> 'externalIds') jsonb_path_ops) WITH (fastupdate=off);--> statement-breakpoint +CREATE INDEX "feature_id_rights_revoked_idx" ON "conditions"."feature" USING btree ("id") WHERE "conditions"."feature"."tombstone_reason" = 'rights_revoked';--> statement-breakpoint +CREATE INDEX "feature_id_bytes_idx" ON "conditions"."feature" USING btree ("id" COLLATE "C");--> statement-breakpoint +CREATE INDEX "feature_canonical_member_ids_idx" ON "conditions"."feature_canonical" USING gin ("member_ids") WITH (fastupdate=off);--> statement-breakpoint +CREATE INDEX "feature_component_kind_idx" ON "conditions"."feature_component" USING btree ("kind");--> statement-breakpoint +CREATE INDEX "feature_component_external_ids_idx" ON "conditions"."feature_component" USING gin ("external_ids" jsonb_path_ops);--> statement-breakpoint +CREATE INDEX "feature_link_b_id_idx" ON "conditions"."feature_link" USING btree ("b_id");--> statement-breakpoint +CREATE INDEX "feature_revision_recorded_at_idx" ON "conditions"."feature_revision" USING btree ("recorded_at");--> statement-breakpoint +CREATE INDEX "offer_subject_id_component_key_idx" ON "conditions"."offer" USING btree ("subject_id","component_key");--> statement-breakpoint +CREATE INDEX "offer_kind_valid_to_idx" ON "conditions"."offer" USING btree ("kind","valid_to");--> statement-breakpoint +CREATE INDEX "offer_geom_idx" ON "conditions"."offer" USING gist ("geom");--> statement-breakpoint +CREATE INDEX "offer_source_id_id_idx" ON "conditions"."offer" USING btree ("source_id","id");--> statement-breakpoint +CREATE INDEX "offer_canonical_id_idx" ON "conditions"."offer" USING btree ("canonical_id");--> statement-breakpoint +CREATE INDEX "offer_expires_at_idx" ON "conditions"."offer" USING btree ("expires_at") WHERE "conditions"."offer"."tombstoned_at" IS NULL;--> statement-breakpoint +CREATE INDEX "offer_tombstoned_at_idx" ON "conditions"."offer" USING btree ("tombstoned_at") WHERE "conditions"."offer"."tombstoned_at" IS NOT NULL;--> statement-breakpoint +CREATE INDEX "offer_id_rights_revoked_idx" ON "conditions"."offer" USING btree ("id") WHERE "conditions"."offer"."tombstone_reason" = 'rights_revoked';--> statement-breakpoint +CREATE INDEX "offer_id_bytes_idx" ON "conditions"."offer" USING btree ("id" COLLATE "C");--> statement-breakpoint +CREATE INDEX "offer_revision_recorded_at_idx" ON "conditions"."offer_revision" USING btree ("recorded_at");--> statement-breakpoint +CREATE INDEX "record_relation_to_class_to_id_idx" ON "conditions"."record_relation" USING btree ("to_class","to_id");--> statement-breakpoint +CREATE INDEX "situation_geom_idx" ON "conditions"."situation" USING gist ("geom");--> statement-breakpoint +CREATE INDEX "situation_kind_type_idx" ON "conditions"."situation" USING btree ("kind","type");--> statement-breakpoint +CREATE INDEX "situation_source_id_id_idx" ON "conditions"."situation" USING btree ("source_id","id");--> statement-breakpoint +CREATE INDEX "situation_canonical_id_idx" ON "conditions"."situation" USING btree ("canonical_id");--> statement-breakpoint +CREATE INDEX "situation_valid_to_idx" ON "conditions"."situation" USING btree ("valid_to");--> statement-breakpoint +CREATE INDEX "situation_expires_at_idx" ON "conditions"."situation" USING btree ("expires_at");--> statement-breakpoint +CREATE INDEX "situation_group_id_idx" ON "conditions"."situation" USING btree ("group_id");--> statement-breakpoint +CREATE INDEX "situation_evidence_state_crowd_idx" ON "conditions"."situation" USING btree ("evidence_state") WHERE "conditions"."situation"."origin" = 'crowd';--> statement-breakpoint +CREATE INDEX "situation_tombstoned_at_idx" ON "conditions"."situation" USING btree ("tombstoned_at") WHERE "conditions"."situation"."tombstoned_at" IS NOT NULL;--> statement-breakpoint +CREATE INDEX "situation_id_rights_revoked_idx" ON "conditions"."situation" USING btree ("id") WHERE "conditions"."situation"."tombstone_reason" = 'rights_revoked';--> statement-breakpoint +CREATE INDEX "situation_id_bytes_idx" ON "conditions"."situation" USING btree ("id" COLLATE "C");--> statement-breakpoint +CREATE INDEX "situation_effect_kind_valid_to_idx" ON "conditions"."situation_effect" USING btree ("kind","valid_to");--> statement-breakpoint +CREATE INDEX "situation_effect_geom_idx" ON "conditions"."situation_effect" USING gist ("geom");--> statement-breakpoint +CREATE INDEX "situation_revision_recorded_at_idx" ON "conditions"."situation_revision" USING btree ("recorded_at");--> statement-breakpoint +CREATE INDEX "federation_lapsed_copy_peer_instance_id_source_id_idx" ON "conditions"."federation_lapsed_copy" USING btree ("peer_instance_id","source_id");--> statement-breakpoint +CREATE INDEX "federation_outbox_record_class_record_id_seq_idx" ON "conditions"."federation_outbox" USING btree ("record_class","record_id","seq");--> statement-breakpoint +CREATE INDEX "federation_outbox_txid_seq_idx" ON "conditions"."federation_outbox" USING btree ("txid","seq");--> statement-breakpoint +CREATE INDEX "federation_outbox_created_at_idx" ON "conditions"."federation_outbox" USING btree ("created_at");--> statement-breakpoint +CREATE INDEX "federation_subscription_peer_id_idx" ON "conditions"."federation_subscription" USING btree ("peer_id");--> statement-breakpoint +CREATE UNIQUE INDEX "federation_subscription_target_key" ON "conditions"."federation_subscription" USING btree ("peer_id","delivery_mode",coalesce("inbox_url", '')) WHERE "conditions"."federation_subscription"."delivery_mode" <> 'sse';--> statement-breakpoint +CREATE INDEX "federation_tombstone_expires_at_idx" ON "conditions"."federation_tombstone" USING btree ("expires_at");--> statement-breakpoint +CREATE INDEX "osm_road_geom_idx" ON "conditions"."osm_road" USING gist ("geom");--> statement-breakpoint +CREATE INDEX "osm_road_highway_idx" ON "conditions"."osm_road" USING btree ("highway");--> statement-breakpoint +CREATE INDEX "osm_road_ref_idx" ON "conditions"."osm_road" USING btree ("ref");--> statement-breakpoint +CREATE INDEX "reporter_last_active_at_idx" ON "conditions"."reporter" USING btree ("last_active_at");--> statement-breakpoint +CREATE INDEX "road_segment_geom_idx" ON "conditions"."road_segment" USING gist ("geom");--> statement-breakpoint +CREATE INDEX "road_segment_way_id_idx" ON "conditions"."road_segment" USING btree ("way_id");--> statement-breakpoint +CREATE INDEX "road_segment_min_zoom_idx" ON "conditions"."road_segment" USING btree ("min_zoom");--> statement-breakpoint +CREATE INDEX "sensor_baseline_source_dow_bucket_tod_bucket_idx" ON "conditions"."sensor_baseline" USING btree ("source","dow_bucket","tod_bucket");--> statement-breakpoint +CREATE INDEX "sensor_segment_segment_id_idx" ON "conditions"."sensor_segment" USING btree ("segment_id");--> statement-breakpoint +CREATE INDEX "source_poll_attempt_source_attempted_at_idx" ON "conditions"."source_poll_attempt" USING btree ("source","attempted_at");--> statement-breakpoint +CREATE INDEX "source_poll_attempt_attempted_at_id_idx" ON "conditions"."source_poll_attempt" USING btree ("attempted_at","id");--> statement-breakpoint +CREATE INDEX "spent_token_expires_at_idx" ON "conditions"."spent_token" USING btree ("expires_at"); \ No newline at end of file diff --git a/packages/core/drizzle/0000_init_conditions_observations.sql b/packages/core/drizzle/0000_init_conditions_observations.sql deleted file mode 100644 index 37d4b254a..000000000 --- a/packages/core/drizzle/0000_init_conditions_observations.sql +++ /dev/null @@ -1,45 +0,0 @@ -CREATE TABLE "conditions"."observations" ( - "id" text PRIMARY KEY NOT NULL, - "source" text NOT NULL, - "source_format" text NOT NULL, - "domain" text NOT NULL, - "kind" text NOT NULL, - "type" text, - "subtype" text, - "category" text, - "severity" text, - "severity_source" text, - "headline" text, - "description" text, - "metric" text, - "value" double precision, - "level" text, - "unit" text, - "aggregation" text, - "status" text DEFAULT 'active' NOT NULL, - "geom" geometry(Geometry, 4326) NOT NULL, - "subject" jsonb, - "attributes" jsonb, - "valid_from" timestamp with time zone, - "valid_to" timestamp with time zone, - "schedule" jsonb, - "confidence" text, - "is_forecast" boolean DEFAULT false NOT NULL, - "related_ids" jsonb, - "origin" jsonb NOT NULL, - "data_updated_at" timestamp with time zone NOT NULL, - "fetched_at" timestamp with time zone NOT NULL, - "expires_at" timestamp with time zone, - "is_stale" boolean DEFAULT false NOT NULL, - "stale_after" timestamp with time zone -); ---> statement-breakpoint -CREATE INDEX "idx_conditions_obs_geom" ON "conditions"."observations" USING gist ("geom");--> statement-breakpoint -CREATE INDEX "idx_conditions_obs_domain" ON "conditions"."observations" USING btree ("domain");--> statement-breakpoint -CREATE INDEX "idx_conditions_obs_dom_type" ON "conditions"."observations" USING btree ("domain","type");--> statement-breakpoint -CREATE INDEX "idx_conditions_obs_severity" ON "conditions"."observations" USING btree ("severity");--> statement-breakpoint -CREATE INDEX "idx_conditions_obs_metric" ON "conditions"."observations" USING btree ("metric");--> statement-breakpoint -CREATE INDEX "idx_conditions_obs_valid_to" ON "conditions"."observations" USING btree ("valid_to");--> statement-breakpoint -CREATE INDEX "idx_conditions_obs_expires" ON "conditions"."observations" USING btree ("expires_at");--> statement-breakpoint -CREATE INDEX "idx_conditions_obs_subject" ON "conditions"."observations" USING gin ("subject");--> statement-breakpoint -CREATE INDEX "idx_conditions_obs_source" ON "conditions"."observations" USING btree ("source"); \ No newline at end of file diff --git a/packages/core/drizzle/0001_add_label.sql b/packages/core/drizzle/0001_add_label.sql deleted file mode 100644 index 3709c9c54..000000000 --- a/packages/core/drizzle/0001_add_label.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE "conditions"."observations" ADD COLUMN "label" text; \ No newline at end of file diff --git a/packages/core/drizzle/0001_database_objects.sql b/packages/core/drizzle/0001_database_objects.sql new file mode 100644 index 000000000..b0bc14748 --- /dev/null +++ b/packages/core/drizzle/0001_database_objects.sql @@ -0,0 +1,625 @@ +-- What drizzle-kit cannot express: the partitioned observation history, the +-- storage settings of the latest readings, functions (among them the one +-- that grants the roles of OpenMapX's traffic tile and the contributions +-- service), triggers and the federation journal's first epoch. Everything +-- drizzle-kit can express is declared in the schema code and generated into +-- the baseline. +-- +-- The compact observation history: one row per reading of a series in +-- observation_latest, holding only what varies between readings. Partitioned +-- first by the series' retention class (a property's raw-history days, 0 for +-- keep-everything), then by the reading's start, so retention drops whole +-- partitions. The ingest service creates and drops the partitions; a row with +-- no partition is an error, never a default partition. The fixed-width +-- columns come first, widest alignment first, so no row pays alignment +-- padding between them. +CREATE TABLE "conditions"."observation" ( + "series_id" bigint NOT NULL, + "phenomenon_start" timestamp with time zone NOT NULL, + "issued_at" timestamp with time zone DEFAULT '-infinity' NOT NULL, + "fetched_at" timestamp with time zone NOT NULL, + "recorded_at" timestamp with time zone NOT NULL, + "phenomenon_end" timestamp with time zone, + "result_time" timestamp with time zone, + "valid_until" timestamp with time zone, + "value_num" double precision, + "fetch_id" bigint, + "retention_days" smallint NOT NULL, + "raw_part" smallint, + "temporality" text NOT NULL, + "aggregation" text NOT NULL, + "value_money" numeric(14, 4), + "value_text" text, + "value_json" jsonb, + "quality" jsonb, + "baseline" jsonb, + "extra" jsonb, + CONSTRAINT "observation_pkey" PRIMARY KEY ("series_id", "phenomenon_start", "issued_at", "retention_days"), + CONSTRAINT "observation_retention_days_check" CHECK ("retention_days" >= 0) +) PARTITION BY LIST ("retention_days"); +--> statement-breakpoint +-- History is read by series through the primary key (it leads with +-- series_id) and dropped a partition at a time; only the hourly rollup reads +-- by time alone, an hour of a day partition. Readings arrive roughly in time +-- order, so a block range index serves that read for a few pages a +-- partition, where a btree on time took about a fifth of every row's bytes. +CREATE INDEX "observation_phenomenon_start_idx" ON "conditions"."observation" USING brin ("phenomenon_start"); +--> statement-breakpoint +-- A latest row keeps its reading inline and its series template out of +-- line: a row grows past the tuple target only by its template (about a +-- kilobyte), whose storage EXTERNAL moves it to the TOAST table, and an +-- update that keeps it carries only its pointer; the reading's storage MAIN +-- keeps it in the row, so an update writes no TOAST entry. Rows of about a +-- kilobyte leave room on their page for heap-only updates. A flow source +-- rewrites tens of thousands of readings a minute; the template changes when +-- the site does. +ALTER TABLE "conditions"."observation_latest" ALTER COLUMN "template" SET STORAGE EXTERNAL; +--> statement-breakpoint +ALTER TABLE "conditions"."observation_latest" ALTER COLUMN "reading" SET STORAGE MAIN; +--> statement-breakpoint +ALTER TABLE "conditions"."observation_latest" SET (toast_tuple_target = 1200, fillfactor = 50); +--> statement-breakpoint +-- A latest row is updated in place by every poll of its source, and nearly +-- every update is heap-only: the next update or read of its page prunes +-- the old version, with no vacuum needed. The default thresholds count those +-- updates as if vacuum had to clean them up, so a flow source rewriting a +-- hundred thousand readings a minute had the table vacuumed every few +-- minutes and analysed every minute, each pass dirtying pages the updates +-- had just written. Vacuum is left for the index entries of the updates +-- that are not heap-only (category readings, expiries), when the dead rows +-- reach half the table, and analysis for when the table has changed twice +-- over: an update changes a reading, not the distribution of series the +-- planner reads. +ALTER TABLE "conditions"."observation_latest" SET (autovacuum_vacuum_scale_factor = 0.5, autovacuum_analyze_scale_factor = 2); +--> statement-breakpoint +-- A fused reading keeps the record IDs of its contributors once, in the +-- reading; its provenance is rebuilt from them when the record is read. +CREATE FUNCTION "conditions".observation_fusion_provenance( + provenance jsonb, ids jsonb, local_id text +) RETURNS jsonb LANGUAGE plpgsql IMMUTABLE AS $$ +DECLARE + merged jsonb; + refs jsonb; +BEGIN + IF provenance ->> 'origin' IS DISTINCT FROM 'derived' + OR COALESCE(provenance ->> 'sourceId', '') NOT IN ('@fused', '@fused-public') + OR jsonb_typeof(provenance -> 'derivedFrom') IS DISTINCT FROM 'object' + OR provenance #>> '{derivedFrom,method}' IS DISTINCT FROM 'fusion' + OR jsonb_typeof(provenance -> 'mergedSources') IS DISTINCT FROM 'array' + OR jsonb_typeof(ids) IS DISTINCT FROM 'array' + OR local_id IS NULL OR local_id !~ '^[0-9a-f]{64}$' THEN + RAISE EXCEPTION 'Invalid compact fused lineage' USING ERRCODE = '22023'; + END IF; + IF jsonb_array_length(ids) = 0 + OR jsonb_array_length(ids) <> jsonb_array_length(provenance -> 'mergedSources') + OR EXISTS (SELECT 1 FROM jsonb_array_elements(ids) WHERE jsonb_typeof(value) <> 'string') + OR EXISTS (SELECT 1 FROM jsonb_array_elements(provenance -> 'mergedSources') + WHERE jsonb_typeof(value) <> 'object') THEN + RAISE EXCEPTION 'Invalid compact fused lineage' USING ERRCODE = '22023'; + END IF; + SELECT jsonb_agg(value || jsonb_build_object('recordId', ids -> (ordinality - 1)::integer) + ORDER BY ordinality) + INTO merged FROM jsonb_array_elements(provenance -> 'mergedSources') WITH ORDINALITY; + SELECT jsonb_agg(jsonb_build_object('class', 'observation', 'id', value) ORDER BY ordinality) + INTO refs FROM jsonb_array_elements(ids) WITH ORDINALITY; + RETURN provenance || jsonb_build_object( + 'recordId', local_id, 'mergedSources', merged, + 'derivedFrom', (provenance -> 'derivedFrom') || jsonb_build_object('records', refs)); +END +$$; +--> statement-breakpoint +-- The stored observation a latest row holds: its series template with the +-- reading's own fields, provenance merged (`recordOf` in code). It decodes +-- both the original reading format and the compact local-id format. +CREATE FUNCTION "conditions".observation_record(template jsonb, reading jsonb) +RETURNS jsonb LANGUAGE sql IMMUTABLE AS $$ + SELECT (template - 'namespace' - 'provenance') || (reading - 'provenance' - '_ocFusionRecordIds') + || jsonb_build_object('provenance', + CASE WHEN reading ? '_ocFusionRecordIds' THEN + conditions.observation_fusion_provenance( + (template -> 'provenance') || COALESCE(reading -> 'provenance', '{}'::jsonb), + reading -> '_ocFusionRecordIds', reading ->> 'id') + ELSE (template -> 'provenance') || COALESCE(reading -> 'provenance', '{}'::jsonb) END) + || CASE WHEN reading ->> 'id' ~ '^[0-9a-f]{64}$' THEN + jsonb_build_object( + 'id', 'oc:observation:' || (template ->> 'namespace') || ':' || (reading ->> 'id'), + 'canonicalId', encode(sha256(convert_to( + '[' || to_json(template ->> 'namespace')::text || ',' + || to_json(reading ->> 'id')::text || ']', 'UTF8')), 'hex')) + ELSE '{}'::jsonb END +$$; +--> statement-breakpoint +-- Journals this instance's own records into the federation outbox, in the +-- writing transaction. Only records a peer may hold are journalled: a record +-- that reached this instance from a peer carries an origin chain and is that +-- peer's to federate, an on-demand answer, a fused row or a crowd +-- observation never leaves the instance, and neither do a restricted +-- source's records. Journalling is gated on a subscription that wants the +-- class (no `classes` in its filter, or `classes` naming it); observations +-- only for a subscription naming the property, since flow series change by +-- the tens of thousands every minute. A tombstone journals a `delete` with +-- its reason and the revision the record ended at, also when no +-- subscription wants the class any more but the record has entries a peer +-- may have pulled; an erasure (`rights_revoked`) also removes the record's +-- earlier entries, so nothing of it can be served again. +CREATE FUNCTION "conditions".federation_wants(cls text) RETURNS boolean AS $$ + SELECT EXISTS ( + SELECT 1 FROM "conditions"."federation_subscription" s + WHERE NOT (s.filter ? 'classes') OR s.filter -> 'classes' ? cls) +$$ LANGUAGE sql STABLE; +--> statement-breakpoint +CREATE FUNCTION "conditions".federation_is_own(rec jsonb, access_mode text) RETURNS boolean AS $$ + SELECT access_mode <> 'on_demand' + AND jsonb_array_length(COALESCE(rec #> '{provenance,originChain}', '[]'::jsonb)) = 0 +$$ LANGUAGE sql IMMUTABLE; +--> statement-breakpoint +-- A journalled delete carries the revision the record ended at, so a +-- subscriber orders it against the record's changes: it ends a copy no newer +-- than that, and a change it received earlier by another channel stays. +CREATE FUNCTION "conditions".federation_journal_tombstone(cls text, rec record) RETURNS void AS $$ +BEGIN + IF NOT "conditions".federation_wants(cls) AND NOT EXISTS ( + SELECT 1 FROM "conditions"."federation_outbox" + WHERE record_class = cls AND record_id = rec.id) THEN + RETURN; + END IF; + INSERT INTO "conditions"."federation_outbox" + (operation, record_class, record_id, canonical_id, kind, domain, tombstone_reason, revision) + VALUES ('delete', cls, rec.id, rec.canonical_id, rec.kind, rec.domain, rec.tombstone_reason, + rec.revision); + IF rec.tombstone_reason = 'rights_revoked' THEN + DELETE FROM "conditions"."federation_outbox" + WHERE record_class = cls AND record_id = rec.id AND operation <> 'delete'; + END IF; +END; +$$ LANGUAGE plpgsql; +--> statement-breakpoint +-- A restricted source's records never leave the instance, as an on-demand +-- answer or a peer's record does not: the capture skips their creates and +-- updates, since none of their content may be journalled. +CREATE FUNCTION "conditions".federation_may_carry(rec jsonb, access_mode text, src text) +RETURNS boolean AS $$ + SELECT "conditions".federation_is_own(rec, access_mode) + AND NOT EXISTS ( + SELECT 1 FROM "conditions"."source" s WHERE s.id = src AND s.restricted) +$$ LANGUAGE sql STABLE; +--> statement-breakpoint +-- A situation's journalled snapshot and priority, shared by the capture and +-- the boot's reconcile of a source turned public, so both journal the same +-- entry. +CREATE FUNCTION "conditions".federation_situation_snapshot(s "conditions"."situation") +RETURNS jsonb AS $$ + SELECT CASE WHEN s.evidence_state IS NULL THEN s.record + ELSE s.record || jsonb_build_object('evidence', jsonb_build_object( + 'state', s.evidence_state, + 'confidenceScore', s.confidence_score, + 'routingEligible', s.routing_eligible, + 'corroborations', s.corroborations)) END +$$ LANGUAGE sql STABLE; +--> statement-breakpoint +-- Priority: what closes a road, all its lanes, or is an incident. +CREATE FUNCTION "conditions".federation_situation_priority(kind text, rec jsonb) +RETURNS boolean AS $$ + SELECT kind = 'incident' OR EXISTS ( + SELECT 1 FROM jsonb_array_elements(COALESCE(rec -> 'effects', '[]'::jsonb)) e + WHERE e ->> 'kind' = 'closure' + OR (e ->> 'kind' = 'lane_restriction' AND e ->> 'vehicleImpact' = 'all_lanes_closed')) +$$ LANGUAGE sql IMMUTABLE; +--> statement-breakpoint +-- Whether a peer may hold this instance's record `rec_id`, of a source now +-- restricted: it has outbox entries, or a subscription wants its class and +-- it was stored by the time its source last turned restricted (entries a +-- peer pulled while the source was public may since have been pruned). A +-- record stored since its source turned restricted, or of a source +-- restricted since it was added, never reached a peer: nothing of it, not +-- even a delete, is journalled. +CREATE FUNCTION "conditions".federation_was_shared( + cls text, rec_id text, rec_created_at timestamptz, src text) +RETURNS boolean AS $$ + SELECT EXISTS ( + SELECT 1 FROM "conditions"."federation_outbox" o + WHERE o.record_class = cls AND o.record_id = rec_id) + OR ("conditions".federation_wants(cls) AND EXISTS ( + SELECT 1 FROM "conditions"."source" s + WHERE s.id = src AND (NOT s.restricted OR rec_created_at <= s.restricted_since))) +$$ LANGUAGE sql STABLE; +--> statement-breakpoint +-- An erasure of a restricted source's own record still erases what a peer +-- may hold of it, and goes out as a delete (which carries no content), so a +-- subscriber erases its copy too; a record no peer can hold journals nothing. +CREATE FUNCTION "conditions".federation_situation_capture() RETURNS trigger AS $$ +BEGIN + IF NOT "conditions".federation_may_carry(NEW.record, NEW.access_mode, NEW.source_id) THEN + IF TG_OP = 'UPDATE' AND NEW.tombstone_reason = 'rights_revoked' + AND OLD.tombstone_reason IS DISTINCT FROM 'rights_revoked' + AND "conditions".federation_is_own(NEW.record, NEW.access_mode) + AND "conditions".federation_was_shared('situation', NEW.id, NEW.created_at, NEW.source_id) THEN + PERFORM "conditions".federation_journal_tombstone('situation', NEW); + END IF; + RETURN NULL; + END IF; + IF NEW.tombstoned_at IS NOT NULL THEN + IF TG_OP = 'UPDATE' AND (OLD.tombstoned_at IS NULL + OR OLD.tombstone_reason IS DISTINCT FROM NEW.tombstone_reason) THEN + PERFORM "conditions".federation_journal_tombstone('situation', NEW); + END IF; + RETURN NULL; + END IF; + IF NOT "conditions".federation_wants('situation') THEN + RETURN NULL; + END IF; + -- A change is a new revision, or new evidence on a crowd report (whose + -- lifetime is part of its evidence). An expiry a feed poll slides along + -- changes neither. + IF TG_OP = 'UPDATE' AND OLD.tombstoned_at IS NULL AND OLD.revision = NEW.revision + AND OLD.evidence_state IS NOT DISTINCT FROM NEW.evidence_state + AND OLD.confidence_score IS NOT DISTINCT FROM NEW.confidence_score + AND OLD.routing_eligible = NEW.routing_eligible + AND OLD.corroborations = NEW.corroborations + AND (NEW.origin <> 'crowd' OR OLD.expires_at IS NOT DISTINCT FROM NEW.expires_at) THEN + RETURN NULL; + END IF; + INSERT INTO "conditions"."federation_outbox" + (operation, record_class, record_id, canonical_id, kind, domain, priority, snapshot) + VALUES ( + CASE WHEN TG_OP = 'INSERT' OR OLD.tombstoned_at IS NOT NULL THEN 'create' ELSE 'update' END, + 'situation', NEW.id, NEW.canonical_id, NEW.kind, NEW.domain, + "conditions".federation_situation_priority(NEW.kind, NEW.record), + "conditions".federation_situation_snapshot(NEW)); + RETURN NULL; +END; +$$ LANGUAGE plpgsql; +--> statement-breakpoint +CREATE FUNCTION "conditions".federation_record_capture() RETURNS trigger AS $$ +BEGIN + IF NOT "conditions".federation_may_carry(NEW.record, NEW.access_mode, NEW.source_id) THEN + IF TG_OP = 'UPDATE' AND NEW.tombstone_reason = 'rights_revoked' + AND OLD.tombstone_reason IS DISTINCT FROM 'rights_revoked' + AND "conditions".federation_is_own(NEW.record, NEW.access_mode) + AND "conditions".federation_was_shared(TG_TABLE_NAME, NEW.id, NEW.created_at, NEW.source_id) THEN + PERFORM "conditions".federation_journal_tombstone(TG_TABLE_NAME, NEW); + END IF; + RETURN NULL; + END IF; + IF NEW.tombstoned_at IS NOT NULL THEN + IF TG_OP = 'UPDATE' AND (OLD.tombstoned_at IS NULL + OR OLD.tombstone_reason IS DISTINCT FROM NEW.tombstone_reason) THEN + PERFORM "conditions".federation_journal_tombstone(TG_TABLE_NAME, NEW); + END IF; + RETURN NULL; + END IF; + IF NOT "conditions".federation_wants(TG_TABLE_NAME) THEN + RETURN NULL; + END IF; + IF TG_OP = 'UPDATE' AND OLD.tombstoned_at IS NULL AND OLD.revision = NEW.revision THEN + RETURN NULL; + END IF; + INSERT INTO "conditions"."federation_outbox" + (operation, record_class, record_id, canonical_id, kind, domain, snapshot) + VALUES ( + CASE WHEN TG_OP = 'INSERT' OR OLD.tombstoned_at IS NOT NULL THEN 'create' ELSE 'update' END, + TG_TABLE_NAME, NEW.id, NEW.canonical_id, NEW.kind, NEW.domain, NEW.record); + RETURN NULL; +END; +$$ LANGUAGE plpgsql; +--> statement-breakpoint +-- Fused rows, full and public, and crowd observations stay on the instance +-- that computed or landed them: a crowd observation's subject is this +-- instance's canonical feature, a cluster of the feature links no peer +-- holds, so the reading would name nothing there. +CREATE FUNCTION "conditions".federation_observation_capture() RETURNS trigger AS $$ +DECLARE + rec jsonb; +BEGIN + -- Cheapest first: the template is out of line, and a flow poll updates a + -- hundred thousand rows no subscription asks for. + IF NEW.source_id IN ('@fused', '@fused-public', 'crowd') + OR NOT EXISTS ( + SELECT 1 FROM "conditions"."federation_subscription" s + WHERE s.filter -> 'properties' ? NEW.property + AND (NOT (s.filter ? 'classes') OR s.filter -> 'classes' ? 'observation')) THEN + RETURN NULL; + END IF; + IF TG_OP = 'UPDATE' AND OLD.reading = NEW.reading AND OLD.template_hash = NEW.template_hash THEN + RETURN NULL; + END IF; + IF NOT "conditions".federation_may_carry(NEW.template, NEW.access_mode, NEW.source_id) THEN + RETURN NULL; + END IF; + rec := "conditions".observation_record(NEW.template, NEW.reading); + INSERT INTO "conditions"."federation_outbox" + (operation, record_class, record_id, canonical_id, kind, domain, property, snapshot) + VALUES ( + CASE TG_OP WHEN 'INSERT' THEN 'create' ELSE 'update' END, + 'observation', rec ->> 'id', rec ->> 'canonicalId', 'observation', + rec ->> 'domain', NEW.property, rec); + RETURN NULL; +END; +$$ LANGUAGE plpgsql; +--> statement-breakpoint +-- Flow credits and permissions. Credits are captured when a measurement is +-- written, never at feature rendering; captured provenance is authoritative +-- and never joins the mutable source catalogue. Native identity remains in +-- rights/contributing; display identity follows the parent. +CREATE FUNCTION conditions.flow_credit_union(credits jsonb) +RETURNS jsonb LANGUAGE sql IMMUTABLE PARALLEL SAFE AS $$ + SELECT COALESCE(jsonb_agg(value ORDER BY value::text), '[]'::jsonb) + FROM (SELECT DISTINCT flat.value FROM jsonb_array_elements(COALESCE(credits, '[]'::jsonb)) entry + CROSS JOIN LATERAL jsonb_array_elements(CASE WHEN jsonb_typeof(entry.value) = 'array' + THEN entry.value ELSE jsonb_build_array(entry.value) END) flat + WHERE jsonb_typeof(flat.value) = 'object') c; +$$; +--> statement-breakpoint +CREATE FUNCTION conditions.flow_field_sources(fields jsonb) +RETURNS jsonb LANGUAGE sql IMMUTABLE PARALLEL SAFE AS $$ + SELECT jsonb_object_agg(key, ids) FROM ( + SELECT f.key, COALESCE(jsonb_agg(DISTINCT c.value->>'sourceId' ORDER BY c.value->>'sourceId') + FILTER (WHERE c.value->>'sourceId' IS NOT NULL), '[]'::jsonb) AS ids + FROM jsonb_each(fields) f LEFT JOIN LATERAL jsonb_array_elements(f.value) c ON true + GROUP BY f.key + ) values_by_field; +$$; +--> statement-breakpoint +CREATE FUNCTION conditions.flow_native_field_sources(fields jsonb, native_source text) +RETURNS jsonb LANGUAGE sql IMMUTABLE PARALLEL SAFE AS $$ + SELECT jsonb_object_agg(key, ids) FROM ( + SELECT f.key, COALESCE(jsonb_agg(DISTINCT CASE WHEN c.value->>'sourceId' = 'openstreetmap' + THEN 'openstreetmap' ELSE native_source END ORDER BY CASE WHEN c.value->>'sourceId' = 'openstreetmap' + THEN 'openstreetmap' ELSE native_source END) FILTER (WHERE c.value IS NOT NULL), '[]'::jsonb) AS ids + FROM jsonb_each(fields) f LEFT JOIN LATERAL jsonb_array_elements(f.value) c ON true GROUP BY f.key + ) values_by_field; +$$; +--> statement-breakpoint +CREATE FUNCTION conditions.flow_known_fields(fields jsonb) +RETURNS jsonb LANGUAGE sql IMMUTABLE PARALLEL SAFE AS $$ + SELECT COALESCE(jsonb_object_agg(key,value),'{}'::jsonb) FROM jsonb_each(fields) + WHERE jsonb_typeof(value) = 'array' AND jsonb_array_length(value) > 0; +$$; +--> statement-breakpoint +-- Captured scoped licence definitions travel with the selected measurement +-- receipts. Permission selection still uses reviewed source IDs and rights. +CREATE FUNCTION conditions.flow_osm_credit() +RETURNS jsonb LANGUAGE sql IMMUTABLE PARALLEL SAFE AS $$ + SELECT '[{"sourceId":"openstreetmap","name":"OpenStreetMap","url":"https://www.openstreetmap.org/copyright","licensing":{"version":1,"bindings":[{"scope":"data","subject":"OpenStreetMap","license":{"kind":"spdx","expression":"ODbL-1.0"}}]},"attributionText":"© OpenStreetMap contributors"}]'::jsonb; +$$; +--> statement-breakpoint +-- Current affirmative policy is synchronized from the reviewed JS registry at boot. +-- Missing measurement evidence and unrecognized IDs fail closed; credits never authorize use. +CREATE FUNCTION conditions.flow_public_licenses(licenses text[]) +RETURNS boolean LANGUAGE sql STABLE PARALLEL SAFE AS $$ + SELECT licenses IS NOT NULL AND cardinality(licenses) > 0 + AND NOT EXISTS (SELECT 1 FROM unnest(licenses) l(license) + WHERE l.license IS NULL OR NOT EXISTS ( + SELECT 1 FROM conditions.public_license_policy p WHERE p.license = l.license)); +$$; +--> statement-breakpoint +-- Null/empty member evidence poisons the union instead of silently disappearing. +CREATE FUNCTION conditions.flow_permission_union(inputs jsonb) +RETURNS text[] LANGUAGE sql IMMUTABLE PARALLEL SAFE AS $$ + SELECT CASE WHEN inputs IS NOT NULL AND jsonb_array_length(inputs) > 0 + AND NOT EXISTS (SELECT 1 FROM jsonb_array_elements(inputs) i + WHERE jsonb_typeof(i) <> 'array' OR i = '[]'::jsonb) + THEN ARRAY(SELECT DISTINCT l.license FROM jsonb_array_elements(inputs) i + CROSS JOIN LATERAL jsonb_array_elements_text(i) l(license) ORDER BY l.license) END; +$$; +--> statement-breakpoint +-- One projection serves native and explicitly captured upstream sources alike. +CREATE FUNCTION conditions.flow_credit_licensing(supplied jsonb) +RETURNS jsonb LANGUAGE plpgsql IMMUTABLE PARALLEL SAFE AS $$ +DECLARE + captured jsonb := supplied->'licensing'; + captured_url text := NULLIF(supplied->>'licenseUrl',''); + declarations jsonb; + matched integer; +BEGIN + IF captured_url IS NULL OR EXISTS ( + SELECT 1 FROM jsonb_array_elements(COALESCE(captured->'declarations','[]'::jsonb)) d WHERE d->>'url'=captured_url + UNION ALL + SELECT 1 FROM jsonb_array_elements(COALESCE(captured->'bindings','[]'::jsonb)) b WHERE b #>> '{license,url}'=captured_url + ) THEN RETURN captured; END IF; + captured := COALESCE(captured,'{"version":1,"bindings":[]}'::jsonb); + declarations := COALESCE(captured->'declarations','[]'::jsonb); + SELECT ordinality::integer-1 INTO matched FROM jsonb_array_elements(declarations) WITH ORDINALITY d(value,ordinality) + WHERE d.value->>'text'=supplied->>'license' AND NOT d.value ? 'url' ORDER BY ordinality LIMIT 1; + IF matched IS NOT NULL THEN + declarations := jsonb_set(declarations,ARRAY[matched::text],(declarations->matched)||jsonb_build_object('url',captured_url)); + ELSE + IF jsonb_array_length(declarations)>=64 OR length(supplied->>'license')>1000 THEN + RAISE EXCEPTION 'captured licence URL exceeds portable declaration capacity'; + END IF; + declarations := declarations || jsonb_build_array(jsonb_strip_nulls(jsonb_build_object('text',supplied->>'license','url',captured_url))); + END IF; + RETURN jsonb_set(captured,'{declarations}',declarations); +END; +$$; +--> statement-breakpoint +CREATE FUNCTION conditions.flow_source_credit(native_source text, supplied jsonb) +RETURNS jsonb LANGUAGE sql IMMUTABLE PARALLEL SAFE AS $$ + SELECT COALESCE(jsonb_agg(jsonb_strip_nulls(jsonb_build_object( + 'sourceId', COALESCE(NULLIF(supplied->>'parentSourceId',''),native_source), + 'name', COALESCE(NULLIF(supplied->>'name',''),supplied->>'provider'), + 'url',supplied->>'url','licensing',conditions.flow_credit_licensing(supplied), + 'attributionText',supplied->>'provider','publisher',supplied->'publisher' + ))),'[]'::jsonb) + WHERE COALESCE(NULLIF(supplied->>'name',''),supplied->>'provider') IS NOT NULL; +$$; +--> statement-breakpoint +CREATE FUNCTION conditions.flow_credit(native_source text, supplied jsonb, upstream jsonb DEFAULT '[]'::jsonb) +RETURNS jsonb LANGUAGE sql IMMUTABLE PARALLEL SAFE AS $$ + WITH credits AS ( + SELECT 0 AS ord,c.value AS credit FROM jsonb_array_elements(conditions.flow_source_credit(native_source,supplied)) c + UNION ALL + SELECT 1,c.value FROM jsonb_array_elements(COALESCE(upstream,'[]'::jsonb)) u + CROSS JOIN LATERAL jsonb_array_elements(CASE WHEN u.value ? 'source' + THEN conditions.flow_source_credit(u.value #>> '{source,sourceId}',u.value #> '{source,attribution}') + ELSE CASE WHEN NULLIF(u.value->>'publisher','') IS NOT NULL + THEN jsonb_build_array(jsonb_strip_nulls(jsonb_build_object( + 'sourceId',COALESCE(NULLIF(supplied->>'parentSourceId',''),native_source), + 'name',COALESCE(NULLIF(supplied->>'name',''),supplied->>'provider') || ' – ' || (u.value->>'publisher'), + 'licensing',u.value->'licensing','attributionText',u.value->>'attribution', + 'publisher',jsonb_build_object('name',u.value->>'publisher') + ))) ELSE '[]'::jsonb END END) c + ) SELECT COALESCE(jsonb_agg(credit ORDER BY ord,credit::text),'[]'::jsonb) + FROM (SELECT credit,min(ord) AS ord FROM credits GROUP BY credit) unique_credits; +$$; +--> statement-breakpoint +-- Both declared selectors remain policy facts even for unsealed custom inputs. +CREATE FUNCTION conditions.flow_receipt_permissions(receipt_ids text[], complete boolean, receipt_version integer) +RETURNS text[] LANGUAGE sql STABLE PARALLEL SAFE AS $$ + SELECT CASE WHEN complete IS TRUE THEN conditions.flow_permission_union(jsonb_agg( + CASE WHEN r.provenance #>> '{attribution,license}' IS NOT NULL THEN to_jsonb( + ARRAY[r.provenance #>> '{attribution,license}'] || ARRAY( + SELECT l.license FROM jsonb_array_elements(COALESCE(r.provenance->'upstream','[]'::jsonb)) u + CROSS JOIN LATERAL(VALUES (CASE WHEN u ? 'license' THEN COALESCE(u->>'license','') END),(CASE WHEN u ? 'source' THEN COALESCE(u #>> '{source,attribution,license}','') END)) l(license) + WHERE l.license IS NOT NULL)) END)) END + FROM unnest(receipt_ids) ids(receipt_id) + LEFT JOIN conditions.contributor_receipt r ON r.id=ids.receipt_id AND r.version=receipt_version; +$$; +--> statement-breakpoint +-- The traffic-flow vector tile OpenMapX serves through Martin; its signature +-- is the contract. Measurements are shown only where every licence the +-- measurement depends on is public and no contributing source is restricted; +-- the OpenStreetMap geometry is always shown. +CREATE FUNCTION conditions.segment_flow(z integer, x integer, y integer, query_params json) +RETURNS bytea AS $$ +DECLARE bounds geometry := ST_TileEnvelope(z, x, y); mvt bytea; +BEGIN + SELECT ST_AsMVT(t, 'segment_flow', 4096, 'geom') INTO mvt FROM ( + SELECT s.segment_id, s.dir, s.highway, + sp.speed_ratio, sp.los, sp.confidence, sp.current_kph, sp.free_flow_kph, + 1 AS lineage_version, + COALESCE(sp.field_sources, jsonb_build_object('geometry', jsonb_build_array('openstreetmap')))::text AS field_sources, + COALESCE(sp.field_contributors, jsonb_build_object('geometry', conditions.flow_osm_credit()))::text AS field_contributors, + COALESCE(sp.field_lineage_complete, jsonb_build_object('geometry',true,'speed',sp.current_kph IS NULL,'freeFlow',sp.free_flow_kph IS NULL,'ratio',sp.speed_ratio IS NULL,'los',sp.los IS NULL,'confidence',sp.confidence IS NULL))::text AS field_lineage_complete, + ST_AsMVTGeom(ST_Transform(s.geom, 3857), bounds, 4096, 64, true) AS geom + FROM conditions.road_segment s + LEFT JOIN conditions.segment_speed sp ON sp.segment_id = s.segment_id + AND conditions.flow_public_licenses(sp.permission_licenses) + AND NOT EXISTS (SELECT 1 FROM conditions.source scope_source + WHERE scope_source.id = ANY(sp.contributing) AND scope_source.restricted) + WHERE s.min_zoom <= z AND s.geom && ST_Transform(bounds, 4326) + ) t WHERE t.geom IS NOT NULL; + RETURN COALESCE(mvt, ''::bytea); +END; +$$ LANGUAGE plpgsql STABLE STRICT PARALLEL SAFE; +--> statement-breakpoint +CREATE TRIGGER federation_capture AFTER INSERT OR UPDATE ON "conditions"."situation" + FOR EACH ROW EXECUTE FUNCTION "conditions".federation_situation_capture(); +--> statement-breakpoint +CREATE TRIGGER federation_capture AFTER INSERT OR UPDATE ON "conditions"."feature" + FOR EACH ROW EXECUTE FUNCTION "conditions".federation_record_capture(); +--> statement-breakpoint +CREATE TRIGGER federation_capture AFTER INSERT OR UPDATE ON "conditions"."offer" + FOR EACH ROW EXECUTE FUNCTION "conditions".federation_record_capture(); +--> statement-breakpoint +CREATE TRIGGER federation_capture AFTER INSERT OR UPDATE ON "conditions"."observation_latest" + FOR EACH ROW EXECUTE FUNCTION "conditions".federation_observation_capture(); +--> statement-breakpoint +-- Deleting a crowd reporter also removes its key from what it reported, in +-- the deleting transaction, whoever deletes it: its latest crowd readings, +-- its crowd situations, their revisions and their journal entries lose +-- `provenance.reporter` (the whole object: a reporter without its key is +-- not a valid record, a record without a reporter is). The rows are found +-- through the reporter's evidence, which still names the key until the +-- delete clears it, so no index on the readings is needed and flow updates +-- stay heap-only. Removing the reporter changes neither revision nor +-- evidence, so the capture journals nothing. Its caller holds the crowd lock +-- first, as landings do, so a landing never writes the key back. +CREATE FUNCTION "conditions".reporter_strip_key() RETURNS trigger LANGUAGE plpgsql +SET search_path = pg_catalog, pg_temp AS $$ +BEGIN + UPDATE "conditions"."observation_latest" AS l + SET reading = l.reading #- '{provenance,reporter}' + WHERE l.crowd_record_id IS NOT NULL + AND l.crowd_record_id IN ( + SELECT e.record_id FROM "conditions"."report_evidence" AS e + WHERE e.actor_key_id = OLD.key_id AND e.record_class = 'observation') + AND l.reading #>> '{provenance,reporter,keyId}' = OLD.key_id; + UPDATE "conditions"."situation" AS s + SET record = s.record #- '{provenance,reporter}' + WHERE s.id IN ( + SELECT e.record_id FROM "conditions"."report_evidence" AS e + WHERE e.actor_key_id = OLD.key_id AND e.record_class = 'situation') + AND s.record #>> '{provenance,reporter,keyId}' = OLD.key_id; + UPDATE "conditions"."situation_revision" AS r + SET snapshot = r.snapshot #- '{provenance,reporter}' + WHERE r.situation_id IN ( + SELECT e.record_id FROM "conditions"."report_evidence" AS e + WHERE e.actor_key_id = OLD.key_id AND e.record_class = 'situation') + AND r.snapshot #>> '{provenance,reporter,keyId}' = OLD.key_id; + UPDATE "conditions"."federation_outbox" AS o + SET snapshot = o.snapshot #- '{provenance,reporter}' + WHERE o.record_class = 'situation' + AND o.record_id IN ( + SELECT e.record_id FROM "conditions"."report_evidence" AS e + WHERE e.actor_key_id = OLD.key_id AND e.record_class = 'situation') + AND o.snapshot #>> '{provenance,reporter,keyId}' = OLD.key_id; + RETURN OLD; +END; +$$; +--> statement-breakpoint +CREATE TRIGGER reporter_strip_key BEFORE DELETE ON "conditions"."reporter" + FOR EACH ROW EXECUTE FUNCTION "conditions".reporter_strip_key(); +--> statement-breakpoint +-- The federation journal's first epoch. The timeline is filled in by the +-- federation service once it can read it. +INSERT INTO "conditions"."federation_journal" (epoch, started_at, seen_xid, timeline_id) +VALUES (gen_random_uuid(), now(), pg_snapshot_xmax(pg_current_snapshot()), NULL); +--> statement-breakpoint +-- Grants the roles of OpenMapX's traffic tile and the contributions service +-- exactly what they use, each only if it exists. The ingest service calls it +-- after every migrate, so a role created later gets its grants at the next +-- start. It runs with its caller's rights: only the owner of these objects +-- (or a superuser) can grant on them, and no other role may call it. +CREATE FUNCTION "conditions".grant_consumer_roles() RETURNS void LANGUAGE plpgsql +SET search_path = pg_catalog, pg_temp AS $$ +BEGIN + -- OpenMapX's traffic tile runs as openmapx_tiles_owner, a role OpenMapX + -- creates that cannot log in. It reads exactly what conditions.segment_flow + -- reads, so credentials, crowd data and everything else stay unreadable to + -- it. + IF EXISTS (SELECT FROM pg_catalog.pg_roles WHERE rolname = 'openmapx_tiles_owner') THEN + GRANT USAGE ON SCHEMA "conditions" TO openmapx_tiles_owner; + GRANT SELECT ON "conditions"."road_segment", "conditions"."segment_speed", + "conditions"."source", "conditions"."public_license_policy" TO openmapx_tiles_owner; + GRANT EXECUTE ON FUNCTION "conditions".segment_flow(integer, integer, integer, json), + "conditions".flow_public_licenses(text[]), "conditions".flow_osm_credit() + TO openmapx_tiles_owner; + END IF; + -- The contributions service's own role gets what its queries use. It reads + -- the migration history to wait for the schema version, and the stored + -- codes and the secrets key check at start. It keeps the crowd's + -- reporters, block list, reports, votes and evidence, the issuer's keys and + -- the tokens it issues and redeems. A report lands as a situation, with its + -- effects, revision and graph binding, or as a latest reading of a feed's + -- feature; its evidence refreshes the fused readings, and a cross-check + -- reads the feeds' readings and their history. Its writes to situations and + -- latest readings also run the federation capture triggers, which read the + -- subscriptions and journal into the outbox. Crowd readings keep no history + -- (every crowd-reported property keeps its latest reading only), and crowd + -- records carry no relations. The ids of the rows it inserts are identity + -- columns, whose defaults need no grant on their sequences. + IF EXISTS (SELECT FROM pg_catalog.pg_roles WHERE rolname = 'openconditions_contributions') THEN + GRANT USAGE ON SCHEMA "conditions" TO openconditions_contributions; + GRANT SELECT ON "conditions"."__drizzle_migrations", "conditions"."source", + "conditions"."feature", "conditions"."feature_component", "conditions"."offer", + "conditions"."feature_canonical", "conditions"."observation", + "conditions"."observation_rollup_progress", "conditions"."source_status", + "conditions"."source_poll_attempt", "conditions"."federation_subscription", + "conditions"."secrets_key_check" TO openconditions_contributions; + GRANT INSERT ON "conditions"."situation_revision" TO openconditions_contributions; + GRANT SELECT, INSERT ON "conditions"."issuer_key", "conditions"."spent_token", + "conditions"."report_evidence", "conditions"."sub_claim", "conditions"."contributor_receipt", + "conditions"."federation_outbox" TO openconditions_contributions; + GRANT SELECT, DELETE ON "conditions"."record_relation" TO openconditions_contributions; + GRANT SELECT, INSERT, DELETE ON "conditions"."report_refusal", "conditions"."situation_effect" + TO openconditions_contributions; + GRANT SELECT, INSERT, UPDATE ON "conditions"."reporter", "conditions"."token_quota", + "conditions"."situation", "conditions"."binding_queue" TO openconditions_contributions; + GRANT SELECT, INSERT, UPDATE, DELETE ON "conditions"."block_list", + "conditions"."observation_latest" TO openconditions_contributions; + END IF; +END; +$$; +--> statement-breakpoint +REVOKE EXECUTE ON FUNCTION "conditions".grant_consumer_roles() FROM PUBLIC; diff --git a/packages/core/drizzle/0002_sensor_baseline_and_speed_sample.sql b/packages/core/drizzle/0002_sensor_baseline_and_speed_sample.sql deleted file mode 100644 index ccaac0a28..000000000 --- a/packages/core/drizzle/0002_sensor_baseline_and_speed_sample.sql +++ /dev/null @@ -1,27 +0,0 @@ -CREATE TABLE "conditions"."sensor_baseline" ( - "sensor_key" text NOT NULL, - "source" text NOT NULL, - "dow_bucket" smallint NOT NULL, - "tod_bucket" smallint NOT NULL, - "free_flow_kph" double precision NOT NULL, - "method" text NOT NULL, - "sample_count" integer NOT NULL, - "computed_at" timestamp with time zone NOT NULL, - CONSTRAINT "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk" PRIMARY KEY("sensor_key","dow_bucket","tod_bucket","method") -); ---> statement-breakpoint -CREATE TABLE "conditions"."sensor_speed_sample" ( - "id" bigserial PRIMARY KEY NOT NULL, - "sensor_key" text NOT NULL, - "source" text NOT NULL, - "observed_at" timestamp with time zone NOT NULL, - "speed_kph" double precision NOT NULL, - "dow" smallint NOT NULL, - "tod_hour" smallint NOT NULL, - "geom" geometry(Geometry, 4326) NOT NULL, - CONSTRAINT "uq_sensor_sample_key_observed" UNIQUE("sensor_key","observed_at") -); ---> statement-breakpoint -CREATE INDEX "idx_sensor_baseline_source_bucket" ON "conditions"."sensor_baseline" USING btree ("source","dow_bucket","tod_bucket");--> statement-breakpoint -CREATE INDEX "idx_sensor_sample_key_bucket" ON "conditions"."sensor_speed_sample" USING btree ("sensor_key","dow","tod_hour");--> statement-breakpoint -CREATE INDEX "idx_sensor_sample_observed" ON "conditions"."sensor_speed_sample" USING btree ("observed_at"); \ No newline at end of file diff --git a/packages/core/drizzle/0003_source_status_and_content_hash.sql b/packages/core/drizzle/0003_source_status_and_content_hash.sql deleted file mode 100644 index 2f099ed4c..000000000 --- a/packages/core/drizzle/0003_source_status_and_content_hash.sql +++ /dev/null @@ -1,11 +0,0 @@ -CREATE TABLE "conditions"."source_status" ( - "source" text PRIMARY KEY NOT NULL, - "last_attempt_at" timestamp with time zone, - "last_success_at" timestamp with time zone, - "freshness_window_sec" integer NOT NULL, - "last_row_count" integer, - "last_error" text, - "updated_at" timestamp with time zone DEFAULT now() NOT NULL -); ---> statement-breakpoint -ALTER TABLE "conditions"."observations" ADD COLUMN "content_hash" text; \ No newline at end of file diff --git a/packages/core/drizzle/0004_segment_spine.sql b/packages/core/drizzle/0004_segment_spine.sql deleted file mode 100644 index 4bc7dfda0..000000000 --- a/packages/core/drizzle/0004_segment_spine.sql +++ /dev/null @@ -1,42 +0,0 @@ -CREATE TABLE "conditions"."osm_road" ( - "way_id" bigint PRIMARY KEY NOT NULL, - "geom" geometry(Geometry, 4326) NOT NULL, - "highway" text NOT NULL, - "oneway" boolean DEFAULT false NOT NULL, - "ref" text, - "name" text, - "maxspeed_kph" double precision, - "region" text NOT NULL, - "imported_at" timestamp with time zone NOT NULL -); ---> statement-breakpoint -CREATE TABLE "conditions"."road_segment" ( - "segment_id" text PRIMARY KEY NOT NULL, - "way_id" bigint NOT NULL, - "dir" text NOT NULL, - "geom" geometry(Geometry, 4326) NOT NULL, - "highway" text NOT NULL, - "ref" text, - "length_m" double precision NOT NULL, - "min_zoom" smallint NOT NULL, - "free_flow_kph" double precision, - "openlr" text, - "computed_at" timestamp with time zone NOT NULL -); ---> statement-breakpoint -CREATE TABLE "conditions"."sensor_segment" ( - "sensor_key" text PRIMARY KEY NOT NULL, - "segment_id" text NOT NULL, - "fraction" double precision NOT NULL, - "offset_m" double precision NOT NULL, - "bearing_deg" double precision, - "matched_at" timestamp with time zone NOT NULL -); ---> statement-breakpoint -CREATE INDEX "idx_osm_road_geom" ON "conditions"."osm_road" USING gist ("geom");--> statement-breakpoint -CREATE INDEX "idx_osm_road_highway" ON "conditions"."osm_road" USING btree ("highway");--> statement-breakpoint -CREATE INDEX "idx_osm_road_ref" ON "conditions"."osm_road" USING btree ("ref");--> statement-breakpoint -CREATE INDEX "idx_road_segment_geom" ON "conditions"."road_segment" USING gist ("geom");--> statement-breakpoint -CREATE INDEX "idx_road_segment_way" ON "conditions"."road_segment" USING btree ("way_id");--> statement-breakpoint -CREATE INDEX "idx_road_segment_minzoom" ON "conditions"."road_segment" USING btree ("min_zoom");--> statement-breakpoint -CREATE INDEX "idx_sensor_segment_segment" ON "conditions"."sensor_segment" USING btree ("segment_id"); \ No newline at end of file diff --git a/packages/core/drizzle/0005_segment_observation_speed.sql b/packages/core/drizzle/0005_segment_observation_speed.sql deleted file mode 100644 index 8d6f668b3..000000000 --- a/packages/core/drizzle/0005_segment_observation_speed.sql +++ /dev/null @@ -1,31 +0,0 @@ -CREATE TABLE "conditions"."segment_observation" ( - "segment_id" text NOT NULL, - "source" text NOT NULL, - "source_tier" text NOT NULL, - "current_kph" double precision, - "free_flow_kph" double precision, - "speed_ratio" double precision, - "los" text NOT NULL, - "confidence" double precision NOT NULL, - "sample_count" integer, - "observed_at" timestamp with time zone NOT NULL, - "expires_at" timestamp with time zone, - CONSTRAINT "segment_observation_segment_id_source_pk" PRIMARY KEY("segment_id","source") -); ---> statement-breakpoint -CREATE TABLE "conditions"."segment_speed" ( - "segment_id" text PRIMARY KEY NOT NULL, - "current_kph" double precision, - "free_flow_kph" double precision, - "speed_ratio" double precision, - "los" text NOT NULL, - "confidence" text NOT NULL, - "source_tier" text, - "contributing" text[], - "is_estimated" boolean DEFAULT false NOT NULL, - "observed_at" timestamp with time zone, - "updated_at" timestamp with time zone NOT NULL -); ---> statement-breakpoint -CREATE INDEX "idx_segment_observation_segment" ON "conditions"."segment_observation" USING btree ("segment_id");--> statement-breakpoint -CREATE INDEX "idx_segment_speed_los" ON "conditions"."segment_speed" USING btree ("los"); \ No newline at end of file diff --git a/packages/core/drizzle/0006_segment_profile.sql b/packages/core/drizzle/0006_segment_profile.sql deleted file mode 100644 index 82b4cafa0..000000000 --- a/packages/core/drizzle/0006_segment_profile.sql +++ /dev/null @@ -1,11 +0,0 @@ -CREATE TABLE "conditions"."segment_profile" ( - "segment_id" text NOT NULL, - "dow" smallint NOT NULL, - "tod_hour" smallint NOT NULL, - "speed_kph" double precision NOT NULL, - "sample_count" integer NOT NULL, - "computed_at" timestamp with time zone NOT NULL, - CONSTRAINT "segment_profile_segment_id_dow_tod_hour_pk" PRIMARY KEY("segment_id","dow","tod_hour") -); ---> statement-breakpoint -CREATE INDEX "idx_segment_profile_segment" ON "conditions"."segment_profile" USING btree ("segment_id"); \ No newline at end of file diff --git a/packages/core/drizzle/0007_commons_observation_fields.sql b/packages/core/drizzle/0007_commons_observation_fields.sql deleted file mode 100644 index c5f8fbed6..000000000 --- a/packages/core/drizzle/0007_commons_observation_fields.sql +++ /dev/null @@ -1,26 +0,0 @@ -ALTER TABLE "conditions"."observations" ADD COLUMN "instance_id" text;--> statement-breakpoint -ALTER TABLE "conditions"."observations" ADD COLUMN "canonical_id" text;--> statement-breakpoint -ALTER TABLE "conditions"."observations" ADD COLUMN "phenomenon_fingerprint" text;--> statement-breakpoint -ALTER TABLE "conditions"."observations" ADD COLUMN "replaces" jsonb;--> statement-breakpoint -ALTER TABLE "conditions"."observations" ADD COLUMN "corroborations" jsonb;--> statement-breakpoint -ALTER TABLE "conditions"."observations" ADD COLUMN "fuzziness" text DEFAULT 'exact' NOT NULL;--> statement-breakpoint -ALTER TABLE "conditions"."observations" ADD COLUMN "confidence_score" double precision;--> statement-breakpoint -ALTER TABLE "conditions"."observations" ADD COLUMN "severity_level" smallint;--> statement-breakpoint -ALTER TABLE "conditions"."observations" ADD COLUMN "privacy_class" text DEFAULT 'unknown' NOT NULL;--> statement-breakpoint -ALTER TABLE "conditions"."observations" ADD COLUMN "k_anonymity" integer;--> statement-breakpoint -ALTER TABLE "conditions"."observations" ADD COLUMN "dp_epsilon" double precision;--> statement-breakpoint -ALTER TABLE "conditions"."observations" ADD COLUMN "dp_delta" double precision;--> statement-breakpoint -ALTER TABLE "conditions"."observations" ADD COLUMN "informed" jsonb;--> statement-breakpoint -ALTER TABLE "conditions"."observations" ADD COLUMN "source_uri" text;--> statement-breakpoint -ALTER TABLE "conditions"."observations" ADD COLUMN "source_license" text;--> statement-breakpoint -CREATE INDEX "idx_conditions_obs_canonical" ON "conditions"."observations" USING btree ("canonical_id");--> statement-breakpoint -CREATE INDEX "idx_conditions_obs_phenomenon" ON "conditions"."observations" USING btree ("phenomenon_fingerprint");--> statement-breakpoint -CREATE INDEX "idx_conditions_obs_instance" ON "conditions"."observations" USING btree ("instance_id");--> statement-breakpoint -CREATE INDEX "idx_conditions_obs_privacy" ON "conditions"."observations" USING btree ("privacy_class");--> statement-breakpoint -ALTER TABLE "conditions"."observations" ADD CONSTRAINT "obs_confidence_score_range" CHECK ("conditions"."observations"."confidence_score" IS NULL OR ("conditions"."observations"."confidence_score" >= 0 AND "conditions"."observations"."confidence_score" <= 1));--> statement-breakpoint -ALTER TABLE "conditions"."observations" ADD CONSTRAINT "obs_dp_epsilon_nonneg" CHECK ("conditions"."observations"."dp_epsilon" IS NULL OR "conditions"."observations"."dp_epsilon" >= 0);--> statement-breakpoint -ALTER TABLE "conditions"."observations" ADD CONSTRAINT "obs_dp_delta_range" CHECK ("conditions"."observations"."dp_delta" IS NULL OR ("conditions"."observations"."dp_delta" >= 0 AND "conditions"."observations"."dp_delta" < 1));--> statement-breakpoint -ALTER TABLE "conditions"."observations" ADD CONSTRAINT "obs_k_anonymity_positive" CHECK ("conditions"."observations"."k_anonymity" IS NULL OR "conditions"."observations"."k_anonymity" > 0);--> statement-breakpoint -ALTER TABLE "conditions"."observations" ADD CONSTRAINT "obs_severity_level_range" CHECK ("conditions"."observations"."severity_level" IS NULL OR ("conditions"."observations"."severity_level" >= 1 AND "conditions"."observations"."severity_level" <= 5));--> statement-breakpoint -ALTER TABLE "conditions"."observations" ADD CONSTRAINT "obs_fuzziness_enum" CHECK ("conditions"."observations"."fuzziness" IN ('exact','low_res','medium_res','end_unknown','start_unknown','extent_unknown'));--> statement-breakpoint -ALTER TABLE "conditions"."observations" ADD CONSTRAINT "obs_privacy_class_enum" CHECK ("conditions"."observations"."privacy_class" IN ('unknown','authoritative','aggregate','k_anon','dp_noised','crowd_pseudonym')); \ No newline at end of file diff --git a/packages/core/drizzle/0008_contribution_tables_evidence_state.sql b/packages/core/drizzle/0008_contribution_tables_evidence_state.sql deleted file mode 100644 index 39ee9635f..000000000 --- a/packages/core/drizzle/0008_contribution_tables_evidence_state.sql +++ /dev/null @@ -1,65 +0,0 @@ -CREATE TABLE "conditions"."issuer_key" ( - "key_id" text PRIMARY KEY NOT NULL, - "public_key" "bytea" NOT NULL, - "private_key" "bytea" NOT NULL, - "not_before" timestamp with time zone NOT NULL, - "not_after" timestamp with time zone NOT NULL -); ---> statement-breakpoint -CREATE TABLE "conditions"."report_evidence" ( - "id" bigserial PRIMARY KEY NOT NULL, - "observation_id" text NOT NULL, - "evidence_kind" text NOT NULL, - "actor_key_id" text, - "source_id" text, - "occurred_at" timestamp with time zone NOT NULL, - "details" jsonb DEFAULT '{}'::jsonb NOT NULL, - CONSTRAINT "report_evidence_kind_enum" CHECK ("conditions"."report_evidence"."evidence_kind" IN ('report','confirm','negate','official_match','reviewer_accept','reviewer_reject','expired')) -); ---> statement-breakpoint -CREATE TABLE "conditions"."reporter" ( - "key_id" text PRIMARY KEY NOT NULL, - "pub_jwk" jsonb NOT NULL, - "osm_uid" text, - "email_lookup_hmac" text, - "reputation_alpha" double precision NOT NULL, - "reputation_beta" double precision NOT NULL, - "corroborated_count" integer DEFAULT 0 NOT NULL, - "flagged_count" integer DEFAULT 0 NOT NULL, - "trust_signal" double precision, - "entitlement_expires_at" timestamp with time zone NOT NULL, - "status" text DEFAULT 'active' NOT NULL, - "created_at" timestamp with time zone NOT NULL, - "last_active_at" timestamp with time zone NOT NULL, - CONSTRAINT "reporter_reputation_alpha_positive" CHECK ("conditions"."reporter"."reputation_alpha" > 0), - CONSTRAINT "reporter_reputation_beta_positive" CHECK ("conditions"."reporter"."reputation_beta" > 0), - CONSTRAINT "reporter_status_enum" CHECK ("conditions"."reporter"."status" IN ('active','blocked')) -); ---> statement-breakpoint -CREATE TABLE "conditions"."sub_claim" ( - "id" text PRIMARY KEY NOT NULL, - "subject_id" text NOT NULL, - "claim_type" text NOT NULL, - "key_id" text NOT NULL, - "reason" text, - "geom" geometry(Point, 4326), - "signature" text NOT NULL, - "created_at" timestamp with time zone NOT NULL, - CONSTRAINT "sub_claim_claim_type_enum" CHECK ("conditions"."sub_claim"."claim_type" IN ('confirm','negate','flag')) -); ---> statement-breakpoint -CREATE TABLE "conditions"."token_quota" ( - "key_id" text NOT NULL, - "epoch" text NOT NULL, - "issued" integer DEFAULT 0 NOT NULL, - CONSTRAINT "token_quota_key_id_epoch_pk" PRIMARY KEY("key_id","epoch") -); ---> statement-breakpoint -ALTER TABLE "conditions"."observations" ADD COLUMN "evidence_state" text;--> statement-breakpoint -ALTER TABLE "conditions"."observations" ADD COLUMN "routing_eligible" boolean DEFAULT false NOT NULL;--> statement-breakpoint -CREATE INDEX "idx_report_evidence_observation" ON "conditions"."report_evidence" USING btree ("observation_id","occurred_at");--> statement-breakpoint -CREATE UNIQUE INDEX "uq_sub_claim_subject_key_type" ON "conditions"."sub_claim" USING btree ("subject_id","key_id","claim_type");--> statement-breakpoint -CREATE INDEX "idx_sub_claim_subject" ON "conditions"."sub_claim" USING btree ("subject_id");--> statement-breakpoint -CREATE INDEX "idx_sub_claim_key" ON "conditions"."sub_claim" USING btree ("key_id");--> statement-breakpoint -CREATE INDEX "idx_conditions_obs_evidence_state" ON "conditions"."observations" USING btree ("evidence_state");--> statement-breakpoint -ALTER TABLE "conditions"."observations" ADD CONSTRAINT "obs_evidence_state_enum" CHECK ("conditions"."observations"."evidence_state" IS NULL OR "conditions"."observations"."evidence_state" IN ('self_reported','corroborated','externally_resolved','negated','expired')); \ No newline at end of file diff --git a/packages/core/drizzle/0009_spent_token_single_use.sql b/packages/core/drizzle/0009_spent_token_single_use.sql deleted file mode 100644 index 02710392b..000000000 --- a/packages/core/drizzle/0009_spent_token_single_use.sql +++ /dev/null @@ -1,7 +0,0 @@ -CREATE TABLE "conditions"."spent_token" ( - "token_hash" text PRIMARY KEY NOT NULL, - "purpose" text NOT NULL, - "spent_at" timestamp with time zone NOT NULL -); ---> statement-breakpoint -CREATE INDEX "idx_spent_token_spent_at" ON "conditions"."spent_token" USING btree ("spent_at"); \ No newline at end of file diff --git a/packages/core/drizzle/0010_observation_flagged_at.sql b/packages/core/drizzle/0010_observation_flagged_at.sql deleted file mode 100644 index 92e75a136..000000000 --- a/packages/core/drizzle/0010_observation_flagged_at.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE "conditions"."observations" ADD COLUMN "flagged_at" timestamp with time zone;--> statement-breakpoint -CREATE INDEX "idx_conditions_obs_flagged" ON "conditions"."observations" USING btree ("flagged_at") WHERE "conditions"."observations"."flagged_at" IS NOT NULL; \ No newline at end of file diff --git a/packages/core/drizzle/0011_report_evidence_actor_index.sql b/packages/core/drizzle/0011_report_evidence_actor_index.sql deleted file mode 100644 index 7f1dd10d1..000000000 --- a/packages/core/drizzle/0011_report_evidence_actor_index.sql +++ /dev/null @@ -1 +0,0 @@ -CREATE INDEX "idx_report_evidence_actor" ON "conditions"."report_evidence" USING btree ("actor_key_id","occurred_at"); \ No newline at end of file diff --git a/packages/core/drizzle/0012_block_list.sql b/packages/core/drizzle/0012_block_list.sql deleted file mode 100644 index 108f1cd09..000000000 --- a/packages/core/drizzle/0012_block_list.sql +++ /dev/null @@ -1,6 +0,0 @@ -CREATE TABLE "conditions"."block_list" ( - "key_id" text PRIMARY KEY NOT NULL, - "reason" text, - "created_at" timestamp with time zone NOT NULL, - "created_by" text NOT NULL -); diff --git a/packages/core/drizzle/0013_federation_instance_key.sql b/packages/core/drizzle/0013_federation_instance_key.sql deleted file mode 100644 index 5335a50ed..000000000 --- a/packages/core/drizzle/0013_federation_instance_key.sql +++ /dev/null @@ -1,9 +0,0 @@ -CREATE TABLE "conditions"."federation_instance_key" ( - "key_id" text PRIMARY KEY NOT NULL, - "public_key" "bytea" NOT NULL, - "private_key" "bytea" NOT NULL, - "multibase" text NOT NULL, - "not_before" timestamp with time zone NOT NULL, - "not_after" timestamp with time zone NOT NULL, - "created_at" timestamp with time zone NOT NULL -); diff --git a/packages/core/drizzle/0014_federation_outbox.sql b/packages/core/drizzle/0014_federation_outbox.sql deleted file mode 100644 index a6a083b3e..000000000 --- a/packages/core/drizzle/0014_federation_outbox.sql +++ /dev/null @@ -1,56 +0,0 @@ -CREATE TABLE "conditions"."federation_outbox" ( - "seq" bigserial PRIMARY KEY NOT NULL, - "object_id" text NOT NULL, - "operation" text NOT NULL, - "canonical_id" text, - "payload_snapshot" jsonb NOT NULL, - "created_at" timestamp with time zone DEFAULT now() NOT NULL, - CONSTRAINT "federation_outbox_operation_enum" CHECK ("conditions"."federation_outbox"."operation" IN ('create','update','delete')) -); ---> statement-breakpoint -CREATE INDEX "idx_federation_outbox_object" ON "conditions"."federation_outbox" USING btree ("object_id","seq"); ---> statement-breakpoint --- Transactional capture: an AFTER row trigger on conditions.observations --- appends one journal entry per mutation in the mutation's own transaction --- (a rollback appends nothing). INSERT -> 'create', UPDATE -> 'update', --- DELETE -> a minimal tombstone marker. The payload is the point-in-time row --- as jsonb with geometry rendered as GeoJSON and origin.reporter STRIPPED so --- no pseudonymous reporter keyId/signature ever rests in the journal --- (matching the app-level stripReporter: origin keeps only kind/attribution). --- Trigger DDL lives here because drizzle-kit cannot model functions/triggers. -CREATE FUNCTION "conditions".federation_outbox_capture() RETURNS trigger AS $$ -DECLARE - payload jsonb; -BEGIN - IF TG_OP = 'DELETE' THEN - INSERT INTO "conditions"."federation_outbox" (object_id, operation, canonical_id, payload_snapshot) - VALUES (OLD.id, 'delete', OLD.canonical_id, - jsonb_build_object('id', OLD.id, 'canonical_id', OLD.canonical_id, 'tombstone', true)); - RETURN OLD; - END IF; - payload := (to_jsonb(NEW) - 'geom') - || jsonb_build_object('geom', ST_AsGeoJSON(NEW.geom)::jsonb); - IF payload -> 'origin' ? 'reporter' THEN - payload := jsonb_set(payload, '{origin}', (payload -> 'origin') - 'reporter'); - END IF; - INSERT INTO "conditions"."federation_outbox" (object_id, operation, canonical_id, payload_snapshot) - VALUES (NEW.id, CASE TG_OP WHEN 'INSERT' THEN 'create' ELSE 'update' END, NEW.canonical_id, payload); - RETURN NEW; -END; -$$ LANGUAGE plpgsql; ---> statement-breakpoint -CREATE TRIGGER federation_outbox_capture_insert -AFTER INSERT ON "conditions"."observations" -FOR EACH ROW EXECUTE FUNCTION "conditions".federation_outbox_capture(); ---> statement-breakpoint --- The WHEN guard keeps a no-op UPDATE statement (identical row image) from --- journalling a spurious 'update' — the swap upsert already gates on --- content_hash, but any other UPDATE path is covered here too. -CREATE TRIGGER federation_outbox_capture_update -AFTER UPDATE ON "conditions"."observations" -FOR EACH ROW WHEN (OLD.* IS DISTINCT FROM NEW.*) -EXECUTE FUNCTION "conditions".federation_outbox_capture(); ---> statement-breakpoint -CREATE TRIGGER federation_outbox_capture_delete -AFTER DELETE ON "conditions"."observations" -FOR EACH ROW EXECUTE FUNCTION "conditions".federation_outbox_capture(); \ No newline at end of file diff --git a/packages/core/drizzle/0015_federation_outbox_txid_cursor.sql b/packages/core/drizzle/0015_federation_outbox_txid_cursor.sql deleted file mode 100644 index 908cbd838..000000000 --- a/packages/core/drizzle/0015_federation_outbox_txid_cursor.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE "conditions"."federation_outbox" ADD COLUMN "txid" "xid8" DEFAULT pg_current_xact_id() NOT NULL;--> statement-breakpoint -CREATE INDEX "idx_federation_outbox_cursor" ON "conditions"."federation_outbox" USING btree ("txid","seq"); \ No newline at end of file diff --git a/packages/core/drizzle/0016_federation_subscription.sql b/packages/core/drizzle/0016_federation_subscription.sql deleted file mode 100644 index 64ad244bd..000000000 --- a/packages/core/drizzle/0016_federation_subscription.sql +++ /dev/null @@ -1,16 +0,0 @@ -CREATE TABLE "conditions"."federation_subscription" ( - "id" text PRIMARY KEY NOT NULL, - "peer_id" text NOT NULL, - "filter" jsonb DEFAULT '{}'::jsonb NOT NULL, - "delivery_mode" text DEFAULT 'pull' NOT NULL, - "inbox_url" text, - "cursor" text DEFAULT '0.0' NOT NULL, - "priority_only" boolean DEFAULT true NOT NULL, - "push_failures" integer DEFAULT 0 NOT NULL, - "status" text DEFAULT 'active' NOT NULL, - "created_at" timestamp with time zone NOT NULL, - "updated_at" timestamp with time zone NOT NULL, - CONSTRAINT "federation_subscription_delivery_mode_enum" CHECK ("conditions"."federation_subscription"."delivery_mode" IN ('pull','webhook','sse')) -); ---> statement-breakpoint -CREATE INDEX "idx_federation_subscription_peer" ON "conditions"."federation_subscription" USING btree ("peer_id"); \ No newline at end of file diff --git a/packages/core/drizzle/0017_observation_content_hash_index.sql b/packages/core/drizzle/0017_observation_content_hash_index.sql deleted file mode 100644 index 346efaf9e..000000000 --- a/packages/core/drizzle/0017_observation_content_hash_index.sql +++ /dev/null @@ -1 +0,0 @@ -CREATE INDEX "idx_conditions_obs_content_hash" ON "conditions"."observations" USING btree ("content_hash"); \ No newline at end of file diff --git a/packages/core/drizzle/0018_observation_tombstone_reason.sql b/packages/core/drizzle/0018_observation_tombstone_reason.sql deleted file mode 100644 index cb8288674..000000000 --- a/packages/core/drizzle/0018_observation_tombstone_reason.sql +++ /dev/null @@ -1,41 +0,0 @@ -ALTER TABLE "conditions"."observations" ADD COLUMN "tombstone_reason" text;--> statement-breakpoint -ALTER TABLE "conditions"."observations" ADD CONSTRAINT "obs_tombstone_reason_enum" CHECK ("conditions"."observations"."tombstone_reason" IS NULL OR "conditions"."observations"."tombstone_reason" IN ('deleted_by_source','gdpr_erasure','retracted_as_wrong','expired','legal_takedown'));--> statement-breakpoint --- Extend the outbox capture trigger (migration 0014) so a deletion carries its --- REASON, and a soft-archive tombstone (status -> 'archived') propagates as a --- federation DELETE rather than a content UPDATE. Non-tombstone create/update --- behaviour is unchanged. CREATE OR REPLACE keeps the existing triggers bound to --- this same function name; drizzle-kit cannot model functions, so the DDL lives --- inline here (same as 0014). -CREATE OR REPLACE FUNCTION "conditions".federation_outbox_capture() RETURNS trigger AS $$ -DECLARE - payload jsonb; -BEGIN - IF TG_OP = 'DELETE' THEN - -- A bare DELETE with no reason is a TTL/expiry sweep -> 'expired'. - INSERT INTO "conditions"."federation_outbox" (object_id, operation, canonical_id, payload_snapshot) - VALUES (OLD.id, 'delete', OLD.canonical_id, - jsonb_build_object('id', OLD.id, 'canonical_id', OLD.canonical_id, 'tombstone', true, - 'reason', COALESCE(OLD.tombstone_reason, 'expired'))); - RETURN OLD; - END IF; - -- A soft tombstone: the reviewer/GDPR/operator path scrubs + archives the row - -- (status -> 'archived') keeping the audit ledger. It must propagate as a - -- federation DELETION, not a content update, so emit a signed tombstone marker - -- with the row's reason instead of the 'update' payload. - IF TG_OP = 'UPDATE' AND NEW.status = 'archived' AND OLD.status <> 'archived' THEN - INSERT INTO "conditions"."federation_outbox" (object_id, operation, canonical_id, payload_snapshot) - VALUES (NEW.id, 'delete', NEW.canonical_id, - jsonb_build_object('id', NEW.id, 'canonical_id', NEW.canonical_id, 'tombstone', true, - 'reason', COALESCE(NEW.tombstone_reason, 'deleted_by_source'))); - RETURN NEW; - END IF; - payload := (to_jsonb(NEW) - 'geom') - || jsonb_build_object('geom', ST_AsGeoJSON(NEW.geom)::jsonb); - IF payload -> 'origin' ? 'reporter' THEN - payload := jsonb_set(payload, '{origin}', (payload -> 'origin') - 'reporter'); - END IF; - INSERT INTO "conditions"."federation_outbox" (object_id, operation, canonical_id, payload_snapshot) - VALUES (NEW.id, CASE TG_OP WHEN 'INSERT' THEN 'create' ELSE 'update' END, NEW.canonical_id, payload); - RETURN NEW; -END; -$$ LANGUAGE plpgsql; \ No newline at end of file diff --git a/packages/core/drizzle/0019_federation_tombstone.sql b/packages/core/drizzle/0019_federation_tombstone.sql deleted file mode 100644 index e29ab7817..000000000 --- a/packages/core/drizzle/0019_federation_tombstone.sql +++ /dev/null @@ -1,6 +0,0 @@ -CREATE TABLE "conditions"."federation_tombstone" ( - "canonical_id" text PRIMARY KEY NOT NULL, - "reason" text NOT NULL, - "tombstoned_at" timestamp with time zone DEFAULT now() NOT NULL, - "expires_at" timestamp with time zone NOT NULL -); diff --git a/packages/core/drizzle/0020_federation_peer_health.sql b/packages/core/drizzle/0020_federation_peer_health.sql deleted file mode 100644 index af2461d45..000000000 --- a/packages/core/drizzle/0020_federation_peer_health.sql +++ /dev/null @@ -1,18 +0,0 @@ -CREATE TABLE "conditions"."federation_blocklist" ( - "peer_id" text PRIMARY KEY NOT NULL, - "reason" text, - "created_at" timestamp with time zone DEFAULT now() NOT NULL, - "created_by" text NOT NULL -); ---> statement-breakpoint -CREATE TABLE "conditions"."federation_peer_health" ( - "peer_id" text PRIMARY KEY NOT NULL, - "availability_ok" integer DEFAULT 0 NOT NULL, - "availability_fail" integer DEFAULT 0 NOT NULL, - "signature_failures" integer DEFAULT 0 NOT NULL, - "replay_failures" integer DEFAULT 0 NOT NULL, - "schema_failures" integer DEFAULT 0 NOT NULL, - "rate_violations" integer DEFAULT 0 NOT NULL, - "effective_tier_until" timestamp with time zone, - "updated_at" timestamp with time zone DEFAULT now() NOT NULL -); diff --git a/packages/core/drizzle/0021_federation_outbox_retention_index.sql b/packages/core/drizzle/0021_federation_outbox_retention_index.sql deleted file mode 100644 index 1e082c06e..000000000 --- a/packages/core/drizzle/0021_federation_outbox_retention_index.sql +++ /dev/null @@ -1 +0,0 @@ -CREATE INDEX "idx_federation_outbox_created_at" ON "conditions"."federation_outbox" USING btree ("created_at"); \ No newline at end of file diff --git a/packages/core/drizzle/0022_equal_wonder_man.sql b/packages/core/drizzle/0022_equal_wonder_man.sql deleted file mode 100644 index fa025247b..000000000 --- a/packages/core/drizzle/0022_equal_wonder_man.sql +++ /dev/null @@ -1,2 +0,0 @@ -CREATE INDEX "idx_conditions_obs_corroborations" ON "conditions"."observations" USING gin ("corroborations");--> statement-breakpoint -CREATE INDEX "idx_conditions_obs_replaces" ON "conditions"."observations" USING gin ("replaces"); \ No newline at end of file diff --git a/packages/core/drizzle/0023_gate_federation_outbox_capture.sql b/packages/core/drizzle/0023_gate_federation_outbox_capture.sql deleted file mode 100644 index 7f4c300c3..000000000 --- a/packages/core/drizzle/0023_gate_federation_outbox_capture.sql +++ /dev/null @@ -1,69 +0,0 @@ --- Gate the outbox capture (migrations 0014, 0018) on there being a subscriber. --- --- The capture trigger journalled a full row snapshot for EVERY observation --- mutation unconditionally. The ingest rewrites its feed observations --- continuously (~20M mutations/day), so on an instance with no federation peers --- this wrote ~1.4M rows/hour (~1.9 KB each) that nothing would ever read, while --- the retention floor in pruneOutbox (Tier-1 backfill window + margin) correctly --- refused to prune them for weeks. It filled the disk and took Postgres down. --- --- Journalling now starts when a peer actually subscribes. TRADE-OFF: a peer that --- subscribes later cannot backfill mutations from before its subscription — the --- journal simply does not exist for that period. That is the intended exchange: --- Tier-1 backfill is bounded anyway, and the alternative is unbounded disk --- growth to serve nobody. federation_subscription is tiny and stays hot in --- cache, so the added per-row EXISTS is far cheaper than the INSERT it avoids. --- --- Everything else (payload shape, reporter stripping, tombstone reasons, the --- archived->delete mapping) is carried over from 0018 UNCHANGED. CREATE OR --- REPLACE keeps the existing triggers bound to this same function name; --- drizzle-kit cannot model functions, so the DDL is authored here (as 0014/0018). -CREATE OR REPLACE FUNCTION "conditions".federation_outbox_capture() RETURNS trigger AS $$ -DECLARE - payload jsonb; -BEGIN - -- No subscriber, no journal. AFTER-trigger return values are ignored; OLD/NEW - -- is returned to match the shape of the paths below. - IF NOT EXISTS (SELECT 1 FROM "conditions"."federation_subscription") THEN - IF TG_OP = 'DELETE' THEN - RETURN OLD; - END IF; - RETURN NEW; - END IF; - - IF TG_OP = 'DELETE' THEN - -- A bare DELETE with no reason is a TTL/expiry sweep -> 'expired'. - INSERT INTO "conditions"."federation_outbox" (object_id, operation, canonical_id, payload_snapshot) - VALUES (OLD.id, 'delete', OLD.canonical_id, - jsonb_build_object('id', OLD.id, 'canonical_id', OLD.canonical_id, 'tombstone', true, - 'reason', COALESCE(OLD.tombstone_reason, 'expired'))); - RETURN OLD; - END IF; - -- A soft tombstone: the reviewer/GDPR/operator path scrubs + archives the row - -- (status -> 'archived') keeping the audit ledger. It must propagate as a - -- federation DELETION, not a content update, so emit a signed tombstone marker - -- with the row's reason instead of the 'update' payload. - IF TG_OP = 'UPDATE' AND NEW.status = 'archived' AND OLD.status <> 'archived' THEN - INSERT INTO "conditions"."federation_outbox" (object_id, operation, canonical_id, payload_snapshot) - VALUES (NEW.id, 'delete', NEW.canonical_id, - jsonb_build_object('id', NEW.id, 'canonical_id', NEW.canonical_id, 'tombstone', true, - 'reason', COALESCE(NEW.tombstone_reason, 'deleted_by_source'))); - RETURN NEW; - END IF; - payload := (to_jsonb(NEW) - 'geom') - || jsonb_build_object('geom', ST_AsGeoJSON(NEW.geom)::jsonb); - IF payload -> 'origin' ? 'reporter' THEN - payload := jsonb_set(payload, '{origin}', (payload -> 'origin') - 'reporter'); - END IF; - INSERT INTO "conditions"."federation_outbox" (object_id, operation, canonical_id, payload_snapshot) - VALUES (NEW.id, CASE TG_OP WHEN 'INSERT' THEN 'create' ELSE 'update' END, NEW.canonical_id, payload); - RETURN NEW; -END; -$$ LANGUAGE plpgsql; ---> statement-breakpoint --- Re-enable the capture triggers: prod had them administratively disabled to --- stop the disk filling. With the gate in the function they are safe to leave --- enabled, and ENABLE is a no-op for triggers that are already enabled. -ALTER TABLE "conditions"."observations" ENABLE TRIGGER federation_outbox_capture_insert;--> statement-breakpoint -ALTER TABLE "conditions"."observations" ENABLE TRIGGER federation_outbox_capture_update;--> statement-breakpoint -ALTER TABLE "conditions"."observations" ENABLE TRIGGER federation_outbox_capture_delete; diff --git a/packages/core/drizzle/0024_sensor_speed_hourly_rollup.sql b/packages/core/drizzle/0024_sensor_speed_hourly_rollup.sql deleted file mode 100644 index 0f4f7252a..000000000 --- a/packages/core/drizzle/0024_sensor_speed_hourly_rollup.sql +++ /dev/null @@ -1,12 +0,0 @@ -CREATE TABLE "conditions"."sensor_speed_hourly" ( - "sensor_key" text NOT NULL, - "hour_utc" timestamp with time zone NOT NULL, - "source" text NOT NULL, - "geom" geometry(Geometry, 4326) NOT NULL, - "sample_count" integer NOT NULL, - "speed_bins" smallint[] NOT NULL, - "speed_counts" integer[] NOT NULL, - CONSTRAINT "sensor_speed_hourly_sensor_key_hour_utc_pk" PRIMARY KEY("sensor_key","hour_utc") -); ---> statement-breakpoint -CREATE INDEX "idx_sensor_hourly_hour" ON "conditions"."sensor_speed_hourly" USING btree ("hour_utc"); \ No newline at end of file diff --git a/packages/core/drizzle/0025_observation_binding.sql b/packages/core/drizzle/0025_observation_binding.sql deleted file mode 100644 index bd1f10029..000000000 --- a/packages/core/drizzle/0025_observation_binding.sql +++ /dev/null @@ -1,28 +0,0 @@ -CREATE TABLE "conditions"."observation_binding" ( - "observation_id" text PRIMARY KEY NOT NULL, - "status" text NOT NULL, - "confidence" double precision, - "direction_mode" text DEFAULT 'single' NOT NULL, - "candidate_count" integer DEFAULT 0 NOT NULL, - "alternative_confidence" double precision, - "reason" text, - "resolver_version" text NOT NULL, - "geom_hash" text NOT NULL, - "bound_at" timestamp with time zone NOT NULL -); ---> statement-breakpoint -CREATE TABLE "conditions"."observation_segment" ( - "observation_id" text NOT NULL, - "seq" smallint NOT NULL, - "segment_id" text NOT NULL, - "way_id" bigint NOT NULL, - "dir" text NOT NULL, - "start_fraction" double precision NOT NULL, - "end_fraction" double precision NOT NULL, - CONSTRAINT "observation_segment_observation_id_seq_pk" PRIMARY KEY("observation_id","seq") -); ---> statement-breakpoint -ALTER TABLE "conditions"."observation_binding" ADD CONSTRAINT "observation_binding_observation_id_observations_id_fk" FOREIGN KEY ("observation_id") REFERENCES "conditions"."observations"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint -ALTER TABLE "conditions"."observation_segment" ADD CONSTRAINT "observation_segment_observation_id_observations_id_fk" FOREIGN KEY ("observation_id") REFERENCES "conditions"."observations"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint -CREATE INDEX "idx_observation_binding_status" ON "conditions"."observation_binding" USING btree ("status");--> statement-breakpoint -CREATE INDEX "idx_observation_segment_segment" ON "conditions"."observation_segment" USING btree ("segment_id"); \ No newline at end of file diff --git a/packages/core/drizzle/0026_poll_facts.sql b/packages/core/drizzle/0026_poll_facts.sql deleted file mode 100644 index 73e99ae04..000000000 --- a/packages/core/drizzle/0026_poll_facts.sql +++ /dev/null @@ -1,46 +0,0 @@ -CREATE TABLE "conditions"."source_poll_attempt" ( - "id" bigserial PRIMARY KEY NOT NULL, - "source" text NOT NULL, - "attempted_at" timestamp with time zone NOT NULL, - "finished_at" timestamp with time zone NOT NULL, - "outcome" text NOT NULL, - "network_validated" boolean NOT NULL, - "published" boolean DEFAULT false NOT NULL, - "active_event_count" integer, - "inserted" integer, - "updated" integer, - "deleted" integer, - "rejected" integer, - "duration_ms" integer, - "partitions_succeeded" integer, - "partitions_failed" integer, - "partitions_total" integer, - "error" text -); ---> statement-breakpoint -ALTER TABLE "conditions"."source_status" ADD COLUMN "last_network_success_at" timestamp with time zone;--> statement-breakpoint -ALTER TABLE "conditions"."source_status" ADD COLUMN "freshness_deadline" timestamp with time zone;--> statement-breakpoint -ALTER TABLE "conditions"."source_status" ADD COLUMN "last_publication_at" timestamp with time zone;--> statement-breakpoint -ALTER TABLE "conditions"."source_status" ADD COLUMN "publication_revision" bigint DEFAULT 0 NOT NULL;--> statement-breakpoint -ALTER TABLE "conditions"."source_status" ADD COLUMN "last_outcome" text;--> statement-breakpoint -ALTER TABLE "conditions"."source_status" ADD COLUMN "active_event_count" integer;--> statement-breakpoint -ALTER TABLE "conditions"."source_status" ADD COLUMN "last_inserted" integer;--> statement-breakpoint -ALTER TABLE "conditions"."source_status" ADD COLUMN "last_updated" integer;--> statement-breakpoint -ALTER TABLE "conditions"."source_status" ADD COLUMN "last_deleted" integer;--> statement-breakpoint -ALTER TABLE "conditions"."source_status" ADD COLUMN "last_rejected" integer;--> statement-breakpoint -ALTER TABLE "conditions"."source_status" ADD COLUMN "last_duration_ms" integer;--> statement-breakpoint -ALTER TABLE "conditions"."source_status" ADD COLUMN "consecutive_failures" integer DEFAULT 0 NOT NULL;--> statement-breakpoint -ALTER TABLE "conditions"."source_status" ADD COLUMN "last_error_at" timestamp with time zone;--> statement-breakpoint -CREATE INDEX "idx_source_poll_attempt_source_time" ON "conditions"."source_poll_attempt" USING btree ("source","attempted_at");--> statement-breakpoint --- The aggregate WZDx parent is replaced by independently scheduled approved --- children. Existing aggregate rows cannot be attributed to a concrete --- publisher, so retain their identity and mark them ineligible rather than --- relabelling them with an invented child licence. -UPDATE "conditions"."observations" -SET "routing_eligible" = false, "evidence_state" = 'unverified' -WHERE "source" = 'us-wzdx';--> statement-breakpoint -UPDATE "conditions"."source_status" -SET "last_outcome" = 'missing_configuration', "freshness_deadline" = NULL, - "last_error" = 'Legacy aggregate disabled; awaiting independently verified child replacement', - "last_error_at" = now(), "updated_at" = now() -WHERE "source" = 'us-wzdx'; diff --git a/packages/core/drizzle/0027_binding_currency.sql b/packages/core/drizzle/0027_binding_currency.sql deleted file mode 100644 index 99ee32e25..000000000 --- a/packages/core/drizzle/0027_binding_currency.sql +++ /dev/null @@ -1,27 +0,0 @@ -CREATE TABLE "conditions"."binding_queue" ( - "observation_id" text PRIMARY KEY NOT NULL, - "observation_revision" text NOT NULL, - "attempts" integer DEFAULT 0 NOT NULL, - "next_attempt_at" timestamp with time zone DEFAULT now() NOT NULL, - "last_error" text, - "updated_at" timestamp with time zone DEFAULT now() NOT NULL -); ---> statement-breakpoint -CREATE TABLE "conditions"."road_graph_state" ( - "singleton" boolean PRIMARY KEY DEFAULT true NOT NULL, - "generation" text NOT NULL, - "status" text DEFAULT 'ready' NOT NULL, - "regions" jsonb NOT NULL, - "highway_classes" jsonb NOT NULL, - "pbf_provenance" jsonb NOT NULL, - "imported_at" timestamp with time zone NOT NULL, - "activated_at" timestamp with time zone NOT NULL, - CONSTRAINT "road_graph_state_singleton" CHECK ("conditions"."road_graph_state"."singleton" IS TRUE) -); ---> statement-breakpoint -ALTER TABLE "conditions"."observation_binding" ADD COLUMN "observation_revision" text;--> statement-breakpoint -ALTER TABLE "conditions"."observation_binding" ADD COLUMN "graph_generation" text;--> statement-breakpoint -ALTER TABLE "conditions"."osm_road" ADD COLUMN "import_config_hash" text;--> statement-breakpoint -ALTER TABLE "conditions"."osm_road" ADD COLUMN "import_provenance" jsonb;--> statement-breakpoint -ALTER TABLE "conditions"."binding_queue" ADD CONSTRAINT "binding_queue_observation_id_observations_id_fk" FOREIGN KEY ("observation_id") REFERENCES "conditions"."observations"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint -CREATE INDEX "idx_binding_queue_due" ON "conditions"."binding_queue" USING btree ("next_attempt_at"); diff --git a/packages/core/drizzle/0028_segment_flow_function.sql b/packages/core/drizzle/0028_segment_flow_function.sql deleted file mode 100644 index d2cbe5a2e..000000000 --- a/packages/core/drizzle/0028_segment_flow_function.sql +++ /dev/null @@ -1,16 +0,0 @@ --- Versioned tile-function ownership: runtime startup must not replace newer SQL. -CREATE OR REPLACE FUNCTION conditions.segment_flow(z integer, x integer, y integer, query_params json) - RETURNS bytea AS $$ - DECLARE bounds geometry := ST_TileEnvelope(z, x, y); mvt bytea; - BEGIN - SELECT ST_AsMVT(t, 'segment_flow', 4096, 'geom') INTO mvt FROM ( - SELECT s.segment_id, s.dir, s.highway, - sp.speed_ratio, sp.los, sp.confidence, sp.current_kph, sp.free_flow_kph, - ST_AsMVTGeom(ST_Transform(s.geom, 3857), bounds, 4096, 64, true) AS geom - FROM conditions.road_segment s - LEFT JOIN conditions.segment_speed sp USING (segment_id) - WHERE s.min_zoom <= z AND s.geom && ST_Transform(bounds, 4326) - ) t WHERE t.geom IS NOT NULL; - RETURN COALESCE(mvt, ''::bytea); - END; - $$ LANGUAGE plpgsql STABLE STRICT PARALLEL SAFE; diff --git a/packages/core/drizzle/0029_tombstone_reason_escalation.sql b/packages/core/drizzle/0029_tombstone_reason_escalation.sql deleted file mode 100644 index 42eb28652..000000000 --- a/packages/core/drizzle/0029_tombstone_reason_escalation.sql +++ /dev/null @@ -1,45 +0,0 @@ --- An erasure that strengthens an archived record must propagate to peers. --- Preserve existing capture gating, payloads and reporter stripping. -CREATE OR REPLACE FUNCTION "conditions".federation_outbox_capture() RETURNS trigger AS $$ -DECLARE - payload jsonb; -BEGIN - -- No subscriber, no journal. AFTER-trigger return values are ignored; OLD/NEW - -- is returned to match the shape of the paths below. - IF NOT EXISTS (SELECT 1 FROM "conditions"."federation_subscription") THEN - IF TG_OP = 'DELETE' THEN - RETURN OLD; - END IF; - RETURN NEW; - END IF; - - IF TG_OP = 'DELETE' THEN - -- A bare DELETE with no reason is a TTL/expiry sweep -> 'expired'. - INSERT INTO "conditions"."federation_outbox" (object_id, operation, canonical_id, payload_snapshot) - VALUES (OLD.id, 'delete', OLD.canonical_id, - jsonb_build_object('id', OLD.id, 'canonical_id', OLD.canonical_id, 'tombstone', true, - 'reason', COALESCE(OLD.tombstone_reason, 'expired'))); - RETURN OLD; - END IF; - -- A soft tombstone: the reviewer/GDPR/operator path scrubs + archives the row - -- (status -> 'archived') keeping the audit ledger. It must propagate as a - -- federation DELETION, not a content update, so emit a signed tombstone marker - -- with the row's reason instead of the 'update' payload. - IF TG_OP = 'UPDATE' AND NEW.status = 'archived' - AND (OLD.status <> 'archived' OR NEW.tombstone_reason IS DISTINCT FROM OLD.tombstone_reason) THEN - INSERT INTO "conditions"."federation_outbox" (object_id, operation, canonical_id, payload_snapshot) - VALUES (NEW.id, 'delete', NEW.canonical_id, - jsonb_build_object('id', NEW.id, 'canonical_id', NEW.canonical_id, 'tombstone', true, - 'reason', COALESCE(NEW.tombstone_reason, 'deleted_by_source'))); - RETURN NEW; - END IF; - payload := (to_jsonb(NEW) - 'geom') - || jsonb_build_object('geom', ST_AsGeoJSON(NEW.geom)::jsonb); - IF payload -> 'origin' ? 'reporter' THEN - payload := jsonb_set(payload, '{origin}', (payload -> 'origin') - 'reporter'); - END IF; - INSERT INTO "conditions"."federation_outbox" (object_id, operation, canonical_id, payload_snapshot) - VALUES (NEW.id, CASE TG_OP WHEN 'INSERT' THEN 'create' ELSE 'update' END, NEW.canonical_id, payload); - RETURN NEW; -END; -$$ LANGUAGE plpgsql; diff --git a/packages/core/drizzle/0030_source_poll_retention.sql b/packages/core/drizzle/0030_source_poll_retention.sql deleted file mode 100644 index 270495263..000000000 --- a/packages/core/drizzle/0030_source_poll_retention.sql +++ /dev/null @@ -1 +0,0 @@ -CREATE INDEX "idx_source_poll_attempt_time" ON "conditions"."source_poll_attempt" USING btree ("attempted_at","id"); \ No newline at end of file diff --git a/packages/core/drizzle/0031_subscription_revisions.sql b/packages/core/drizzle/0031_subscription_revisions.sql deleted file mode 100644 index 95d91be44..000000000 --- a/packages/core/drizzle/0031_subscription_revisions.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE "conditions"."federation_subscription" ADD COLUMN "revision" integer DEFAULT 0 NOT NULL; \ No newline at end of file diff --git a/packages/core/drizzle/0032_speed_bucket_finalization.sql b/packages/core/drizzle/0032_speed_bucket_finalization.sql deleted file mode 100644 index db7cbc018..000000000 --- a/packages/core/drizzle/0032_speed_bucket_finalization.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE "conditions"."sensor_speed_hourly" ADD COLUMN "finalized" boolean DEFAULT false NOT NULL; \ No newline at end of file diff --git a/packages/core/drizzle/0033_speed_rollup_progress.sql b/packages/core/drizzle/0033_speed_rollup_progress.sql deleted file mode 100644 index 74db36530..000000000 --- a/packages/core/drizzle/0033_speed_rollup_progress.sql +++ /dev/null @@ -1,5 +0,0 @@ -CREATE TABLE "conditions"."speed_rollup_progress" ( - "id" integer PRIMARY KEY DEFAULT 1 NOT NULL, - "finalized_before" timestamp with time zone NOT NULL, - CONSTRAINT "speed_rollup_progress_singleton" CHECK ("conditions"."speed_rollup_progress"."id" = 1) -); diff --git a/packages/core/drizzle/0034_poll_attempt_payload_hashes.sql b/packages/core/drizzle/0034_poll_attempt_payload_hashes.sql deleted file mode 100644 index 4beccd7ea..000000000 --- a/packages/core/drizzle/0034_poll_attempt_payload_hashes.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE "conditions"."source_poll_attempt" ADD COLUMN "payload_hashes" text[]; \ No newline at end of file diff --git a/packages/core/drizzle/0035_kernel_vocabulary_checks.sql b/packages/core/drizzle/0035_kernel_vocabulary_checks.sql deleted file mode 100644 index 883b27072..000000000 --- a/packages/core/drizzle/0035_kernel_vocabulary_checks.sql +++ /dev/null @@ -1,6 +0,0 @@ -ALTER TABLE "conditions"."observations" DROP CONSTRAINT "obs_fuzziness_enum";--> statement-breakpoint -ALTER TABLE "conditions"."observations" DROP CONSTRAINT "obs_privacy_class_enum";--> statement-breakpoint -ALTER TABLE "conditions"."observations" DROP CONSTRAINT "obs_evidence_state_enum";--> statement-breakpoint -ALTER TABLE "conditions"."observations" ADD CONSTRAINT "obs_fuzziness_enum" CHECK ("fuzziness" IN ('exact', 'low_res', 'medium_res', 'end_unknown', 'start_unknown', 'extent_unknown'));--> statement-breakpoint -ALTER TABLE "conditions"."observations" ADD CONSTRAINT "obs_privacy_class_enum" CHECK ("privacy_class" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym', 'unknown'));--> statement-breakpoint -ALTER TABLE "conditions"."observations" ADD CONSTRAINT "obs_evidence_state_enum" CHECK ("conditions"."observations"."evidence_state" IS NULL OR "evidence_state" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')); \ No newline at end of file diff --git a/packages/core/drizzle/0036_source_registry.sql b/packages/core/drizzle/0036_source_registry.sql deleted file mode 100644 index e625e4b20..000000000 --- a/packages/core/drizzle/0036_source_registry.sql +++ /dev/null @@ -1,29 +0,0 @@ -CREATE TABLE "conditions"."source" ( - "id" text PRIMARY KEY NOT NULL, - "domain" text NOT NULL, - "format" text NOT NULL, - "produces" text NOT NULL, - "access_mode" text NOT NULL, - "tier" text NOT NULL, - "country" text NOT NULL, - "subdivision" text, - "operator" text NOT NULL, - "license" text NOT NULL, - "license_url" text, - "attribution" text NOT NULL, - "rights" jsonb, - "cadence_sec" integer NOT NULL, - "freshness_window_sec" integer NOT NULL, - "raw_retention" text, - "extras_allow" text[] DEFAULT '{}'::text[] NOT NULL, - "extras_federate" boolean DEFAULT false NOT NULL, - "lane_numbering" text, - "parent_source_id" text, - "policy_ids" text[], - "selection_state" text, - "active" boolean DEFAULT true NOT NULL, - "updated_at" timestamp with time zone DEFAULT now() NOT NULL, - CONSTRAINT "source_access_mode_enum" CHECK ("access_mode" IN ('bulk', 'on_demand')), - CONSTRAINT "source_tier_enum" CHECK ("tier" IN ('authoritative', 'operator', 'aggregator', 'community')), - CONSTRAINT "source_produces_enum" CHECK ("conditions"."source"."produces" IN ('events', 'flow')) -); diff --git a/packages/core/drizzle/0037_record_classes.sql b/packages/core/drizzle/0037_record_classes.sql deleted file mode 100644 index 0e3332642..000000000 --- a/packages/core/drizzle/0037_record_classes.sql +++ /dev/null @@ -1,260 +0,0 @@ -CREATE TABLE "conditions"."feature" ( - "id" text PRIMARY KEY NOT NULL, - "record" jsonb NOT NULL, - "canonical_id" text NOT NULL, - "kind" text NOT NULL, - "type" text, - "subtype" text, - "domain" text NOT NULL, - "temporality" text NOT NULL, - "source_id" text NOT NULL, - "source_record_id" text NOT NULL, - "origin" text NOT NULL, - "access_mode" text NOT NULL, - "privacy_class" text NOT NULL, - "instance_id" text NOT NULL, - "revision" integer NOT NULL, - "recorded_at" timestamp with time zone NOT NULL, - "content_hash" text NOT NULL, - "fetched_at" timestamp with time zone NOT NULL, - "expires_at" timestamp with time zone, - "geom" geometry(Geometry, 4326), - "country" text, - "subdivision" text, - "tombstone_reason" text, - "tombstoned_at" timestamp with time zone, - "lifecycle" text NOT NULL, - CONSTRAINT "feature_temporality_enum" CHECK ("temporality" IN ('static', 'scheduled', 'live', 'forecast')), - CONSTRAINT "feature_origin_enum" CHECK ("origin" IN ('feed', 'crowd', 'federation', 'derived')), - CONSTRAINT "feature_access_mode_enum" CHECK ("access_mode" IN ('bulk', 'on_demand')), - CONSTRAINT "feature_privacy_class_enum" CHECK ("privacy_class" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')), - CONSTRAINT "feature_tombstone_reason_enum" CHECK (tombstone_reason IS NULL OR "tombstone_reason" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')), - CONSTRAINT "feature_tombstone_complete" CHECK ((tombstone_reason IS NULL) = (tombstoned_at IS NULL)), - CONSTRAINT "feature_revision_positive" CHECK (revision > 0), - CONSTRAINT "feature_lifecycle_enum" CHECK ("lifecycle" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')) -); ---> statement-breakpoint -CREATE TABLE "conditions"."feature_canonical" ( - "canonical_feature_id" text PRIMARY KEY NOT NULL, - "survivor_id" text NOT NULL, - "member_ids" text[] NOT NULL, - "merged_sources" jsonb, - "computed_at" timestamp with time zone NOT NULL -); ---> statement-breakpoint -CREATE TABLE "conditions"."feature_component" ( - "feature_id" text NOT NULL, - "key" text NOT NULL, - "parent_key" text, - "kind" text NOT NULL, - "lifecycle" text, - "position" geometry(Point, 4326), - "external_ids" jsonb, - "details" jsonb NOT NULL, - "content_hash" text NOT NULL, - CONSTRAINT "feature_component_feature_id_key_pk" PRIMARY KEY("feature_id","key"), - CONSTRAINT "feature_component_lifecycle_enum" CHECK (lifecycle IS NULL OR "lifecycle" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')) -); ---> statement-breakpoint -CREATE TABLE "conditions"."feature_link" ( - "a_id" text NOT NULL, - "b_id" text NOT NULL, - "method" text NOT NULL, - "confidence" double precision NOT NULL, - "status" text NOT NULL, - "decided_by" text, - "decided_at" timestamp with time zone NOT NULL, - CONSTRAINT "feature_link_a_id_b_id_pk" PRIMARY KEY("a_id","b_id"), - CONSTRAINT "feature_link_ordered" CHECK ("conditions"."feature_link"."a_id" < "conditions"."feature_link"."b_id"), - CONSTRAINT "feature_link_method_enum" CHECK ("method" IN ('external_id', 'spatial_attribute', 'manual')), - CONSTRAINT "feature_link_status_enum" CHECK ("status" IN ('accepted', 'rejected', 'pending')) -); ---> statement-breakpoint -CREATE TABLE "conditions"."feature_revision" ( - "feature_id" text NOT NULL, - "revision" integer NOT NULL, - "recorded_at" timestamp with time zone NOT NULL, - "change_kinds" text[] NOT NULL, - "snapshot" jsonb NOT NULL, - CONSTRAINT "feature_revision_feature_id_revision_pk" PRIMARY KEY("feature_id","revision") -); ---> statement-breakpoint -CREATE TABLE "conditions"."offer" ( - "id" text PRIMARY KEY NOT NULL, - "record" jsonb NOT NULL, - "canonical_id" text NOT NULL, - "kind" text NOT NULL, - "type" text, - "subtype" text, - "domain" text NOT NULL, - "temporality" text NOT NULL, - "source_id" text NOT NULL, - "source_record_id" text NOT NULL, - "origin" text NOT NULL, - "access_mode" text NOT NULL, - "privacy_class" text NOT NULL, - "instance_id" text NOT NULL, - "revision" integer NOT NULL, - "recorded_at" timestamp with time zone NOT NULL, - "content_hash" text NOT NULL, - "fetched_at" timestamp with time zone NOT NULL, - "expires_at" timestamp with time zone, - "geom" geometry(Geometry, 4326), - "country" text, - "subdivision" text, - "tombstone_reason" text, - "tombstoned_at" timestamp with time zone, - "subject_class" text NOT NULL, - "subject_id" text NOT NULL, - "component_key" text, - "currency" text NOT NULL, - "valid_from" timestamp with time zone, - "valid_to" timestamp with time zone, - "min_price" numeric(14, 4), - "max_price" numeric(14, 4), - CONSTRAINT "offer_temporality_enum" CHECK ("temporality" IN ('static', 'scheduled', 'live', 'forecast')), - CONSTRAINT "offer_origin_enum" CHECK ("origin" IN ('feed', 'crowd', 'federation', 'derived')), - CONSTRAINT "offer_access_mode_enum" CHECK ("access_mode" IN ('bulk', 'on_demand')), - CONSTRAINT "offer_privacy_class_enum" CHECK ("privacy_class" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')), - CONSTRAINT "offer_tombstone_reason_enum" CHECK (tombstone_reason IS NULL OR "tombstone_reason" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')), - CONSTRAINT "offer_tombstone_complete" CHECK ((tombstone_reason IS NULL) = (tombstoned_at IS NULL)), - CONSTRAINT "offer_revision_positive" CHECK (revision > 0), - CONSTRAINT "offer_subject_class_enum" CHECK ("subject_class" IN ('feature', 'situation', 'observation', 'offer')) -); ---> statement-breakpoint -CREATE TABLE "conditions"."offer_revision" ( - "offer_id" text NOT NULL, - "revision" integer NOT NULL, - "recorded_at" timestamp with time zone NOT NULL, - "change_kinds" text[] NOT NULL, - "snapshot" jsonb NOT NULL, - CONSTRAINT "offer_revision_offer_id_revision_pk" PRIMARY KEY("offer_id","revision") -); ---> statement-breakpoint -CREATE TABLE "conditions"."record_relation" ( - "from_class" text NOT NULL, - "from_id" text NOT NULL, - "relation" text NOT NULL, - "to_class" text NOT NULL, - "to_id" text NOT NULL, - "component_key" text DEFAULT '' NOT NULL, - CONSTRAINT "record_relation_pk" PRIMARY KEY("from_class","from_id","relation","to_class","to_id","component_key"), - CONSTRAINT "record_relation_from_class_enum" CHECK ("from_class" IN ('feature', 'situation', 'observation', 'offer')), - CONSTRAINT "record_relation_to_class_enum" CHECK ("to_class" IN ('feature', 'situation', 'observation', 'offer')), - CONSTRAINT "record_relation_relation_enum" CHECK ("relation" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')) -); ---> statement-breakpoint -CREATE TABLE "conditions"."situation" ( - "id" text PRIMARY KEY NOT NULL, - "record" jsonb NOT NULL, - "canonical_id" text NOT NULL, - "kind" text NOT NULL, - "type" text, - "subtype" text, - "domain" text NOT NULL, - "temporality" text NOT NULL, - "source_id" text NOT NULL, - "source_record_id" text NOT NULL, - "origin" text NOT NULL, - "access_mode" text NOT NULL, - "privacy_class" text NOT NULL, - "instance_id" text NOT NULL, - "revision" integer NOT NULL, - "recorded_at" timestamp with time zone NOT NULL, - "content_hash" text NOT NULL, - "fetched_at" timestamp with time zone NOT NULL, - "expires_at" timestamp with time zone, - "geom" geometry(Geometry, 4326), - "country" text, - "subdivision" text, - "tombstone_reason" text, - "tombstoned_at" timestamp with time zone, - "severity" text NOT NULL, - "severity_level" smallint, - "certainty" text NOT NULL, - "planned" boolean NOT NULL, - "validity_status" text NOT NULL, - "valid_from" timestamp with time zone, - "valid_to" timestamp with time zone, - "group_id" text, - "evidence_state" text, - "confidence_score" double precision, - "routing_eligible" boolean DEFAULT false NOT NULL, - "corroborations" integer DEFAULT 0 NOT NULL, - "flagged_at" timestamp with time zone, - CONSTRAINT "situation_temporality_enum" CHECK ("temporality" IN ('static', 'scheduled', 'live', 'forecast')), - CONSTRAINT "situation_origin_enum" CHECK ("origin" IN ('feed', 'crowd', 'federation', 'derived')), - CONSTRAINT "situation_access_mode_enum" CHECK ("access_mode" IN ('bulk', 'on_demand')), - CONSTRAINT "situation_privacy_class_enum" CHECK ("privacy_class" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')), - CONSTRAINT "situation_tombstone_reason_enum" CHECK (tombstone_reason IS NULL OR "tombstone_reason" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')), - CONSTRAINT "situation_tombstone_complete" CHECK ((tombstone_reason IS NULL) = (tombstoned_at IS NULL)), - CONSTRAINT "situation_revision_positive" CHECK (revision > 0), - CONSTRAINT "situation_severity_enum" CHECK ("severity" IN ('minor', 'moderate', 'major', 'critical', 'unknown')), - CONSTRAINT "situation_severity_level_range" CHECK ("conditions"."situation"."severity_level" IS NULL OR "conditions"."situation"."severity_level" BETWEEN 1 AND 5), - CONSTRAINT "situation_certainty_enum" CHECK ("certainty" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')), - CONSTRAINT "situation_validity_status_enum" CHECK ("validity_status" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')), - CONSTRAINT "situation_evidence_state_enum" CHECK (evidence_state IS NULL OR "evidence_state" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')) -); ---> statement-breakpoint -CREATE TABLE "conditions"."situation_effect" ( - "situation_id" text NOT NULL, - "effect_id" text NOT NULL, - "phase_id" text DEFAULT '' NOT NULL, - "kind" text NOT NULL, - "applicability_kind" text NOT NULL, - "normalization" text NOT NULL, - "compliance" text NOT NULL, - "direction" text, - "valid_from" timestamp with time zone, - "valid_to" timestamp with time zone, - "geom" geometry(Geometry, 4326), - "value" jsonb NOT NULL, - CONSTRAINT "situation_effect_situation_id_effect_id_pk" PRIMARY KEY("situation_id","effect_id"), - CONSTRAINT "situation_effect_applicability_enum" CHECK ("applicability_kind" IN ('all', 'classes', 'unknown')), - CONSTRAINT "situation_effect_normalization_enum" CHECK ("normalization" IN ('complete', 'partial', 'unsupported')), - CONSTRAINT "situation_effect_compliance_enum" CHECK ("compliance" IN ('mandatory', 'advisory', 'unknown')) -); ---> statement-breakpoint -CREATE TABLE "conditions"."situation_revision" ( - "situation_id" text NOT NULL, - "revision" integer NOT NULL, - "recorded_at" timestamp with time zone NOT NULL, - "change_kinds" text[] NOT NULL, - "snapshot" jsonb NOT NULL, - CONSTRAINT "situation_revision_situation_id_revision_pk" PRIMARY KEY("situation_id","revision") -); ---> statement-breakpoint -ALTER TABLE "conditions"."feature_component" ADD CONSTRAINT "feature_component_feature_id_feature_id_fk" FOREIGN KEY ("feature_id") REFERENCES "conditions"."feature"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint -ALTER TABLE "conditions"."feature_revision" ADD CONSTRAINT "feature_revision_feature_id_feature_id_fk" FOREIGN KEY ("feature_id") REFERENCES "conditions"."feature"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint -ALTER TABLE "conditions"."offer_revision" ADD CONSTRAINT "offer_revision_offer_id_offer_id_fk" FOREIGN KEY ("offer_id") REFERENCES "conditions"."offer"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint -ALTER TABLE "conditions"."situation_effect" ADD CONSTRAINT "situation_effect_situation_id_situation_id_fk" FOREIGN KEY ("situation_id") REFERENCES "conditions"."situation"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint -ALTER TABLE "conditions"."situation_revision" ADD CONSTRAINT "situation_revision_situation_id_situation_id_fk" FOREIGN KEY ("situation_id") REFERENCES "conditions"."situation"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint -CREATE INDEX "idx_feature_geom" ON "conditions"."feature" USING gist ("geom");--> statement-breakpoint -CREATE INDEX "idx_feature_kind_type" ON "conditions"."feature" USING btree ("kind","type");--> statement-breakpoint -CREATE INDEX "idx_feature_source" ON "conditions"."feature" USING btree ("source_id");--> statement-breakpoint -CREATE INDEX "idx_feature_canonical" ON "conditions"."feature" USING btree ("canonical_id");--> statement-breakpoint -CREATE INDEX "idx_feature_kind_lifecycle" ON "conditions"."feature" USING btree ("kind","lifecycle");--> statement-breakpoint -CREATE INDEX "idx_feature_canonical_members" ON "conditions"."feature_canonical" USING gin ("member_ids");--> statement-breakpoint -CREATE INDEX "idx_feature_component_kind" ON "conditions"."feature_component" USING btree ("kind");--> statement-breakpoint -CREATE INDEX "idx_feature_component_external_ids" ON "conditions"."feature_component" USING gin ("external_ids" jsonb_path_ops);--> statement-breakpoint -CREATE INDEX "idx_feature_link_b" ON "conditions"."feature_link" USING btree ("b_id");--> statement-breakpoint -CREATE INDEX "idx_feature_revision_recorded" ON "conditions"."feature_revision" USING btree ("recorded_at");--> statement-breakpoint -CREATE INDEX "idx_offer_subject" ON "conditions"."offer" USING btree ("subject_id","component_key");--> statement-breakpoint -CREATE INDEX "idx_offer_kind_valid_to" ON "conditions"."offer" USING btree ("kind","valid_to");--> statement-breakpoint -CREATE INDEX "idx_offer_geom" ON "conditions"."offer" USING gist ("geom");--> statement-breakpoint -CREATE INDEX "idx_offer_source" ON "conditions"."offer" USING btree ("source_id");--> statement-breakpoint -CREATE INDEX "idx_offer_canonical" ON "conditions"."offer" USING btree ("canonical_id");--> statement-breakpoint -CREATE INDEX "idx_offer_revision_recorded" ON "conditions"."offer_revision" USING btree ("recorded_at");--> statement-breakpoint -CREATE INDEX "idx_record_relation_to" ON "conditions"."record_relation" USING btree ("to_class","to_id");--> statement-breakpoint -CREATE INDEX "idx_situation_geom" ON "conditions"."situation" USING gist ("geom");--> statement-breakpoint -CREATE INDEX "idx_situation_kind_type" ON "conditions"."situation" USING btree ("kind","type");--> statement-breakpoint -CREATE INDEX "idx_situation_source" ON "conditions"."situation" USING btree ("source_id");--> statement-breakpoint -CREATE INDEX "idx_situation_canonical" ON "conditions"."situation" USING btree ("canonical_id");--> statement-breakpoint -CREATE INDEX "idx_situation_valid_to" ON "conditions"."situation" USING btree ("valid_to");--> statement-breakpoint -CREATE INDEX "idx_situation_expires" ON "conditions"."situation" USING btree ("expires_at");--> statement-breakpoint -CREATE INDEX "idx_situation_group" ON "conditions"."situation" USING btree ("group_id");--> statement-breakpoint -CREATE INDEX "idx_situation_crowd_evidence" ON "conditions"."situation" USING btree ("origin","evidence_state") WHERE "conditions"."situation"."origin" = 'crowd';--> statement-breakpoint -CREATE INDEX "idx_situation_tombstoned" ON "conditions"."situation" USING btree ("tombstoned_at") WHERE "conditions"."situation"."tombstoned_at" IS NOT NULL;--> statement-breakpoint -CREATE INDEX "idx_situation_effect_kind_valid_to" ON "conditions"."situation_effect" USING btree ("kind","valid_to");--> statement-breakpoint -CREATE INDEX "idx_situation_effect_geom" ON "conditions"."situation_effect" USING gist ("geom");--> statement-breakpoint -CREATE INDEX "idx_situation_revision_recorded" ON "conditions"."situation_revision" USING btree ("recorded_at"); \ No newline at end of file diff --git a/packages/core/drizzle/0038_observation_series.sql b/packages/core/drizzle/0038_observation_series.sql deleted file mode 100644 index e3f4c607c..000000000 --- a/packages/core/drizzle/0038_observation_series.sql +++ /dev/null @@ -1,68 +0,0 @@ -CREATE TABLE "conditions"."observation_latest" ( - "series_id" bigserial PRIMARY KEY NOT NULL, - "subject_key" text NOT NULL, - "property" text NOT NULL, - "qualifier_key" text DEFAULT '' NOT NULL, - "source_id" text NOT NULL, - "subject_kind" text NOT NULL, - "feature_id" text, - "component_key" text, - "situation_id" text, - "geom" geometry(Geometry, 4326), - "record" jsonb NOT NULL, - "template" jsonb NOT NULL, - "access_mode" text NOT NULL, - "result_type" text NOT NULL, - "value_num" double precision, - "value_money" numeric(14, 4), - "value_text" text, - "unit" text, - "currency" text, - "effective_from" timestamp with time zone NOT NULL, - "effective_until" timestamp with time zone, - "since_at" timestamp with time zone NOT NULL, - "fused_from" text[], - "expires_at" timestamp with time zone, - "retention_days" smallint, - "updated_at" timestamp with time zone DEFAULT now() NOT NULL, - CONSTRAINT "observation_latest_series" UNIQUE("subject_key","property","qualifier_key","source_id"), - CONSTRAINT "observation_latest_access_mode_enum" CHECK ("access_mode" IN ('bulk', 'on_demand')) -); ---> statement-breakpoint -CREATE TABLE "conditions"."observation_rollup_daily" ( - "series_id" bigint NOT NULL, - "day_utc" date NOT NULL, - "sample_count" integer NOT NULL, - "min" double precision NOT NULL, - "max" double precision NOT NULL, - "mean" double precision NOT NULL, - CONSTRAINT "observation_rollup_daily_series_id_day_utc_pk" PRIMARY KEY("series_id","day_utc") -); ---> statement-breakpoint -CREATE TABLE "conditions"."observation_rollup_hourly" ( - "series_id" bigint NOT NULL, - "hour_utc" timestamp with time zone NOT NULL, - "sample_count" integer NOT NULL, - "bins" smallint[], - "counts" integer[], - "min" double precision NOT NULL, - "max" double precision NOT NULL, - "mean" double precision NOT NULL, - CONSTRAINT "observation_rollup_hourly_series_id_hour_utc_pk" PRIMARY KEY("series_id","hour_utc") -); ---> statement-breakpoint -CREATE TABLE "conditions"."observation_rollup_progress" ( - "period" text PRIMARY KEY NOT NULL, - "finalized_before" timestamp with time zone NOT NULL -); ---> statement-breakpoint -ALTER TABLE "conditions"."observation_rollup_daily" ADD CONSTRAINT "observation_rollup_daily_series_fk" FOREIGN KEY ("series_id") REFERENCES "conditions"."observation_latest"("series_id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint -ALTER TABLE "conditions"."observation_rollup_hourly" ADD CONSTRAINT "observation_rollup_hourly_series_fk" FOREIGN KEY ("series_id") REFERENCES "conditions"."observation_latest"("series_id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint -CREATE INDEX "idx_observation_latest_geom" ON "conditions"."observation_latest" USING gist ("geom");--> statement-breakpoint -CREATE INDEX "idx_observation_latest_property" ON "conditions"."observation_latest" USING btree ("property");--> statement-breakpoint -CREATE INDEX "idx_observation_latest_property_text" ON "conditions"."observation_latest" USING btree ("property","value_text");--> statement-breakpoint -CREATE INDEX "idx_observation_latest_component" ON "conditions"."observation_latest" USING btree ("feature_id","component_key");--> statement-breakpoint -CREATE INDEX "idx_observation_latest_fuel_price" ON "conditions"."observation_latest" USING btree ("value_money") WHERE "conditions"."observation_latest"."property" = 'fuel.price';--> statement-breakpoint -CREATE INDEX "idx_observation_latest_expires" ON "conditions"."observation_latest" USING btree ("expires_at") WHERE "conditions"."observation_latest"."expires_at" IS NOT NULL;--> statement-breakpoint -CREATE INDEX "idx_observation_rollup_daily_day" ON "conditions"."observation_rollup_daily" USING btree ("day_utc");--> statement-breakpoint -CREATE INDEX "idx_observation_rollup_hourly_hour" ON "conditions"."observation_rollup_hourly" USING btree ("hour_utc"); \ No newline at end of file diff --git a/packages/core/drizzle/0039_observation_history.sql b/packages/core/drizzle/0039_observation_history.sql deleted file mode 100644 index 54ecb7806..000000000 --- a/packages/core/drizzle/0039_observation_history.sql +++ /dev/null @@ -1,35 +0,0 @@ --- Custom SQL migration file, put your code below! -- --- The compact observation history: one row per reading of a series in --- observation_latest, holding only what varies between readings. Partitioned --- first by the series' retention class (a property's raw-history days, 0 for --- keep-everything), then by the reading's start, so retention drops whole --- partitions. The ingest service creates and drops the partitions; a row with --- no partition is an error, never a default partition. -CREATE TABLE "conditions"."observation" ( - "series_id" bigint NOT NULL, - "retention_days" smallint NOT NULL, - "phenomenon_start" timestamp with time zone NOT NULL, - "phenomenon_end" timestamp with time zone, - "issued_at" timestamp with time zone DEFAULT '-infinity' NOT NULL, - "result_time" timestamp with time zone, - "valid_until" timestamp with time zone, - "fetched_at" timestamp with time zone NOT NULL, - "recorded_at" timestamp with time zone NOT NULL, - "temporality" text NOT NULL, - "aggregation" text NOT NULL, - "value_num" double precision, - "value_money" numeric(14, 4), - "value_text" text, - "value_json" jsonb, - "quality" jsonb, - "baseline" jsonb, - "fetch_id" bigint, - "raw_part" smallint, - "extra" jsonb, - CONSTRAINT "observation_pk" PRIMARY KEY ("series_id", "phenomenon_start", "issued_at", "retention_days"), - CONSTRAINT "observation_retention_days_nonneg" CHECK ("retention_days" >= 0) -) PARTITION BY LIST ("retention_days"); ---> statement-breakpoint -CREATE INDEX "idx_observation_start" ON "conditions"."observation" USING btree ("phenomenon_start"); ---> statement-breakpoint -ALTER TABLE "conditions"."observation_latest" SET (fillfactor = 70); diff --git a/packages/core/drizzle/0040_raw_payloads.sql b/packages/core/drizzle/0040_raw_payloads.sql deleted file mode 100644 index c79b70d80..000000000 --- a/packages/core/drizzle/0040_raw_payloads.sql +++ /dev/null @@ -1,24 +0,0 @@ -CREATE TABLE "conditions"."raw_payload" ( - "source_id" text NOT NULL, - "hash" text NOT NULL, - "url_key" text NOT NULL, - "fetch_id" bigint, - "media_type" text, - "bytes_raw" bigint NOT NULL, - "bytes_stored" bigint NOT NULL, - "first_fetched_at" timestamp with time zone NOT NULL, - "last_seen_at" timestamp with time zone NOT NULL, - "seen_count" integer DEFAULT 1 NOT NULL, - "tier" text NOT NULL, - "pinned_reason" text, - "storage_key" text NOT NULL, - "base_hash" text, - "evicted_at" timestamp with time zone, - CONSTRAINT "raw_payload_pk" PRIMARY KEY("source_id","hash"), - CONSTRAINT "raw_payload_tier_enum" CHECK ("tier" IN ('situation', 'observation', 'reference', 'hot')) -); ---> statement-breakpoint -ALTER TABLE "conditions"."source_poll_attempt" ALTER COLUMN "finished_at" DROP NOT NULL;--> statement-breakpoint -CREATE INDEX "idx_raw_payload_source_time" ON "conditions"."raw_payload" USING btree ("source_id","first_fetched_at");--> statement-breakpoint -CREATE INDEX "idx_raw_payload_tier_seen" ON "conditions"."raw_payload" USING btree ("tier","last_seen_at") WHERE "conditions"."raw_payload"."evicted_at" IS NULL;--> statement-breakpoint -CREATE INDEX "idx_raw_payload_base" ON "conditions"."raw_payload" USING btree ("source_id","base_hash") WHERE "conditions"."raw_payload"."base_hash" IS NOT NULL; \ No newline at end of file diff --git a/packages/core/drizzle/0041_raw_eviction_warning.sql b/packages/core/drizzle/0041_raw_eviction_warning.sql deleted file mode 100644 index 381027930..000000000 --- a/packages/core/drizzle/0041_raw_eviction_warning.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE "conditions"."source_status" ADD COLUMN "raw_hot_evicted_at" timestamp with time zone; \ No newline at end of file diff --git a/packages/core/drizzle/0042_record_bindings.sql b/packages/core/drizzle/0042_record_bindings.sql deleted file mode 100644 index f9f40bd00..000000000 --- a/packages/core/drizzle/0042_record_bindings.sql +++ /dev/null @@ -1,34 +0,0 @@ -CREATE TABLE "conditions"."record_binding" ( - "record_class" text NOT NULL, - "record_id" text NOT NULL, - "effect_id" text DEFAULT '' NOT NULL, - "status" text NOT NULL, - "confidence" double precision, - "direction_mode" text NOT NULL, - "candidate_count" integer DEFAULT 0 NOT NULL, - "alternative_confidence" double precision, - "reason" text, - "resolver_version" text NOT NULL, - "geom_hash" text NOT NULL, - "record_revision" integer NOT NULL, - "graph_generation" text, - "bound_at" timestamp with time zone NOT NULL, - CONSTRAINT "record_binding_record_class_record_id_effect_id_pk" PRIMARY KEY("record_class","record_id","effect_id"), - CONSTRAINT "record_binding_record_class_enum" CHECK ("record_class" IN ('feature', 'situation', 'observation', 'offer')) -); ---> statement-breakpoint -CREATE TABLE "conditions"."record_segment" ( - "record_class" text NOT NULL, - "record_id" text NOT NULL, - "effect_id" text DEFAULT '' NOT NULL, - "seq" smallint NOT NULL, - "segment_id" text NOT NULL, - "way_id" bigint NOT NULL, - "dir" text NOT NULL, - "start_fraction" double precision NOT NULL, - "end_fraction" double precision NOT NULL, - CONSTRAINT "record_segment_record_class_record_id_effect_id_seq_pk" PRIMARY KEY("record_class","record_id","effect_id","seq") -); ---> statement-breakpoint -CREATE INDEX "idx_record_binding_status" ON "conditions"."record_binding" USING btree ("status");--> statement-breakpoint -CREATE INDEX "idx_record_segment_segment" ON "conditions"."record_segment" USING btree ("segment_id"); \ No newline at end of file diff --git a/packages/core/drizzle/0043_drop_observation_bindings.sql b/packages/core/drizzle/0043_drop_observation_bindings.sql deleted file mode 100644 index d4488de91..000000000 --- a/packages/core/drizzle/0043_drop_observation_bindings.sql +++ /dev/null @@ -1,3 +0,0 @@ -DROP TABLE "conditions"."binding_queue" CASCADE;--> statement-breakpoint -DROP TABLE "conditions"."observation_binding" CASCADE;--> statement-breakpoint -DROP TABLE "conditions"."observation_segment" CASCADE; \ No newline at end of file diff --git a/packages/core/drizzle/0044_record_binding_queue.sql b/packages/core/drizzle/0044_record_binding_queue.sql deleted file mode 100644 index 7694a2810..000000000 --- a/packages/core/drizzle/0044_record_binding_queue.sql +++ /dev/null @@ -1,13 +0,0 @@ -CREATE TABLE "conditions"."binding_queue" ( - "record_class" text NOT NULL, - "record_id" text NOT NULL, - "effect_id" text DEFAULT '' NOT NULL, - "record_revision" integer NOT NULL, - "attempts" integer DEFAULT 0 NOT NULL, - "next_attempt_at" timestamp with time zone DEFAULT now() NOT NULL, - "last_error" text, - "updated_at" timestamp with time zone DEFAULT now() NOT NULL, - CONSTRAINT "binding_queue_record_class_record_id_effect_id_pk" PRIMARY KEY("record_class","record_id","effect_id") -); ---> statement-breakpoint -CREATE INDEX "idx_binding_queue_due" ON "conditions"."binding_queue" USING btree ("next_attempt_at"); \ No newline at end of file diff --git a/packages/core/drizzle/0045_crowd_records.sql b/packages/core/drizzle/0045_crowd_records.sql deleted file mode 100644 index 8a7d7d145..000000000 --- a/packages/core/drizzle/0045_crowd_records.sql +++ /dev/null @@ -1,24 +0,0 @@ -CREATE TABLE "conditions"."federation_peer_capabilities" ( - "peer_instance_id" text PRIMARY KEY NOT NULL, - "schema_versions" text[] NOT NULL, - "fetched_at" timestamp with time zone NOT NULL -); ---> statement-breakpoint -ALTER TABLE "conditions"."report_evidence" DROP CONSTRAINT "report_evidence_kind_enum";--> statement-breakpoint -ALTER TABLE "conditions"."sub_claim" DROP CONSTRAINT "sub_claim_claim_type_enum";--> statement-breakpoint -DROP INDEX "conditions"."idx_report_evidence_observation";--> statement-breakpoint -DROP INDEX "conditions"."idx_sub_claim_subject";--> statement-breakpoint -DROP INDEX "conditions"."uq_sub_claim_subject_key_type";--> statement-breakpoint -ALTER TABLE "conditions"."report_evidence" ADD COLUMN "record_class" text NOT NULL;--> statement-breakpoint -ALTER TABLE "conditions"."report_evidence" ADD COLUMN "record_id" text NOT NULL;--> statement-breakpoint -ALTER TABLE "conditions"."report_evidence" ADD COLUMN "component_key" text DEFAULT '' NOT NULL;--> statement-breakpoint -ALTER TABLE "conditions"."sub_claim" ADD COLUMN "subject_class" text NOT NULL;--> statement-breakpoint -ALTER TABLE "conditions"."sub_claim" ADD COLUMN "subject_component_key" text DEFAULT '' NOT NULL;--> statement-breakpoint -CREATE INDEX "idx_report_evidence_record" ON "conditions"."report_evidence" USING btree ("record_class","record_id","occurred_at");--> statement-breakpoint -CREATE INDEX "idx_report_evidence_merged" ON "conditions"."report_evidence" USING btree (("details" ->> 'merged')) WHERE "conditions"."report_evidence"."details" ? 'merged';--> statement-breakpoint -CREATE UNIQUE INDEX "uq_sub_claim_subject_key_type" ON "conditions"."sub_claim" USING btree ("subject_class","subject_id","subject_component_key","key_id","claim_type");--> statement-breakpoint -ALTER TABLE "conditions"."report_evidence" DROP COLUMN "observation_id";--> statement-breakpoint -ALTER TABLE "conditions"."report_evidence" ADD CONSTRAINT "report_evidence_record_class_enum" CHECK ("record_class" IN ('feature', 'situation', 'observation', 'offer'));--> statement-breakpoint -ALTER TABLE "conditions"."report_evidence" ADD CONSTRAINT "report_evidence_kind_enum" CHECK ("evidence_kind" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject'));--> statement-breakpoint -ALTER TABLE "conditions"."sub_claim" ADD CONSTRAINT "sub_claim_subject_class_enum" CHECK ("subject_class" IN ('feature', 'situation', 'observation', 'offer'));--> statement-breakpoint -ALTER TABLE "conditions"."sub_claim" ADD CONSTRAINT "sub_claim_claim_type_enum" CHECK ("claim_type" IN ('confirm', 'negate', 'flag')); \ No newline at end of file diff --git a/packages/core/drizzle/0046_retire_observation_outbox.sql b/packages/core/drizzle/0046_retire_observation_outbox.sql deleted file mode 100644 index e4f1d6e50..000000000 --- a/packages/core/drizzle/0046_retire_observation_outbox.sql +++ /dev/null @@ -1,10 +0,0 @@ --- The federation outbox journals model records from now on (the next two --- migrations), so the capture on the flat observations table goes, with its --- function. Its journal rows and the subscriptions, whose filters named legacy --- types, are removed: no instance is deployed, so no peer holds a cursor. -DROP TRIGGER IF EXISTS federation_outbox_capture_insert ON "conditions"."observations";--> statement-breakpoint -DROP TRIGGER IF EXISTS federation_outbox_capture_update ON "conditions"."observations";--> statement-breakpoint -DROP TRIGGER IF EXISTS federation_outbox_capture_delete ON "conditions"."observations";--> statement-breakpoint -DROP FUNCTION IF EXISTS "conditions".federation_outbox_capture();--> statement-breakpoint -DELETE FROM "conditions"."federation_outbox";--> statement-breakpoint -DELETE FROM "conditions"."federation_subscription"; diff --git a/packages/core/drizzle/0047_record_outbox.sql b/packages/core/drizzle/0047_record_outbox.sql deleted file mode 100644 index 251bb5f97..000000000 --- a/packages/core/drizzle/0047_record_outbox.sql +++ /dev/null @@ -1,14 +0,0 @@ -DROP INDEX "conditions"."idx_federation_outbox_object";--> statement-breakpoint -ALTER TABLE "conditions"."federation_outbox" ADD COLUMN "record_class" text NOT NULL;--> statement-breakpoint -ALTER TABLE "conditions"."federation_outbox" ADD COLUMN "record_id" text NOT NULL;--> statement-breakpoint -ALTER TABLE "conditions"."federation_outbox" ADD COLUMN "kind" text NOT NULL;--> statement-breakpoint -ALTER TABLE "conditions"."federation_outbox" ADD COLUMN "domain" text NOT NULL;--> statement-breakpoint -ALTER TABLE "conditions"."federation_outbox" ADD COLUMN "property" text;--> statement-breakpoint -ALTER TABLE "conditions"."federation_outbox" ADD COLUMN "priority" boolean DEFAULT false NOT NULL;--> statement-breakpoint -ALTER TABLE "conditions"."federation_outbox" ADD COLUMN "snapshot" jsonb;--> statement-breakpoint -ALTER TABLE "conditions"."federation_outbox" ADD COLUMN "tombstone_reason" text;--> statement-breakpoint -CREATE INDEX "idx_federation_outbox_record" ON "conditions"."federation_outbox" USING btree ("record_class","record_id","seq");--> statement-breakpoint -ALTER TABLE "conditions"."federation_outbox" DROP COLUMN "object_id";--> statement-breakpoint -ALTER TABLE "conditions"."federation_outbox" DROP COLUMN "payload_snapshot";--> statement-breakpoint -ALTER TABLE "conditions"."federation_outbox" ADD CONSTRAINT "federation_outbox_record_class_enum" CHECK ("record_class" IN ('feature', 'situation', 'observation', 'offer'));--> statement-breakpoint -ALTER TABLE "conditions"."federation_outbox" ADD CONSTRAINT "federation_outbox_delete_shape" CHECK (("conditions"."federation_outbox"."operation" = 'delete') = ("conditions"."federation_outbox"."snapshot" IS NULL AND "conditions"."federation_outbox"."tombstone_reason" IS NOT NULL)); \ No newline at end of file diff --git a/packages/core/drizzle/0048_record_outbox_capture.sql b/packages/core/drizzle/0048_record_outbox_capture.sql deleted file mode 100644 index 91bcce67f..000000000 --- a/packages/core/drizzle/0048_record_outbox_capture.sql +++ /dev/null @@ -1,151 +0,0 @@ --- Journals this instance's own records into the federation outbox, in the --- writing transaction. Only records a peer may hold are journalled: a record --- that reached this instance from a peer carries an origin chain and is that --- peer's to federate, and an on-demand answer or a fused row never leaves --- the instance. Journalling is gated on a subscription that wants the class --- (no `classes` in its filter, or `classes` naming it); observations only for --- a subscription naming the property, since flow series change by the tens of --- thousands every minute. A tombstone journals a `delete` with its reason, --- also when no subscription wants the class any more but the record has --- entries a peer may have pulled; an erasure (`rights_revoked`) also removes --- the record's earlier entries, so nothing of it can be served again. --- drizzle-kit cannot model functions or triggers, so the DDL is authored here. -CREATE FUNCTION "conditions".federation_wants(cls text) RETURNS boolean AS $$ - SELECT EXISTS ( - SELECT 1 FROM "conditions"."federation_subscription" s - WHERE NOT (s.filter ? 'classes') OR s.filter -> 'classes' ? cls) -$$ LANGUAGE sql STABLE; ---> statement-breakpoint -CREATE FUNCTION "conditions".federation_is_own(rec jsonb, access_mode text) RETURNS boolean AS $$ - SELECT access_mode <> 'on_demand' - AND jsonb_array_length(COALESCE(rec #> '{provenance,originChain}', '[]'::jsonb)) = 0 -$$ LANGUAGE sql IMMUTABLE; ---> statement-breakpoint -CREATE FUNCTION "conditions".federation_journal_tombstone(cls text, rec record) RETURNS void AS $$ -BEGIN - IF NOT "conditions".federation_wants(cls) AND NOT EXISTS ( - SELECT 1 FROM "conditions"."federation_outbox" - WHERE record_class = cls AND record_id = rec.id) THEN - RETURN; - END IF; - INSERT INTO "conditions"."federation_outbox" - (operation, record_class, record_id, canonical_id, kind, domain, tombstone_reason) - VALUES ('delete', cls, rec.id, rec.canonical_id, rec.kind, rec.domain, rec.tombstone_reason); - IF rec.tombstone_reason = 'rights_revoked' THEN - DELETE FROM "conditions"."federation_outbox" - WHERE record_class = cls AND record_id = rec.id AND operation <> 'delete'; - END IF; -END; -$$ LANGUAGE plpgsql; ---> statement-breakpoint -CREATE FUNCTION "conditions".federation_situation_capture() RETURNS trigger AS $$ -DECLARE - snapshot jsonb; -BEGIN - IF NOT "conditions".federation_is_own(NEW.record, NEW.access_mode) THEN - RETURN NULL; - END IF; - IF NEW.tombstoned_at IS NOT NULL THEN - IF TG_OP = 'UPDATE' AND (OLD.tombstoned_at IS NULL - OR OLD.tombstone_reason IS DISTINCT FROM NEW.tombstone_reason) THEN - PERFORM "conditions".federation_journal_tombstone('situation', NEW); - END IF; - RETURN NULL; - END IF; - IF NOT "conditions".federation_wants('situation') THEN - RETURN NULL; - END IF; - -- A change is a new revision, or new evidence on a crowd report (whose - -- lifetime is part of its evidence). An expiry a feed poll slides along - -- changes neither. - IF TG_OP = 'UPDATE' AND OLD.tombstoned_at IS NULL AND OLD.revision = NEW.revision - AND OLD.evidence_state IS NOT DISTINCT FROM NEW.evidence_state - AND OLD.confidence_score IS NOT DISTINCT FROM NEW.confidence_score - AND OLD.routing_eligible = NEW.routing_eligible - AND OLD.corroborations = NEW.corroborations - AND (NEW.origin <> 'crowd' OR OLD.expires_at IS NOT DISTINCT FROM NEW.expires_at) THEN - RETURN NULL; - END IF; - snapshot := NEW.record; - IF NEW.evidence_state IS NOT NULL THEN - snapshot := snapshot || jsonb_build_object('evidence', jsonb_build_object( - 'state', NEW.evidence_state, - 'confidenceScore', NEW.confidence_score, - 'routingEligible', NEW.routing_eligible, - 'corroborations', NEW.corroborations)); - END IF; - INSERT INTO "conditions"."federation_outbox" - (operation, record_class, record_id, canonical_id, kind, domain, priority, snapshot) - VALUES ( - CASE WHEN TG_OP = 'INSERT' OR OLD.tombstoned_at IS NOT NULL THEN 'create' ELSE 'update' END, - 'situation', NEW.id, NEW.canonical_id, NEW.kind, NEW.domain, - -- Priority: what closes a road, all its lanes, or is an incident. - NEW.kind = 'incident' OR EXISTS ( - SELECT 1 FROM jsonb_array_elements(COALESCE(NEW.record -> 'effects', '[]'::jsonb)) e - WHERE e ->> 'kind' = 'closure' - OR (e ->> 'kind' = 'lane_restriction' AND e ->> 'vehicleImpact' = 'all_lanes_closed')), - snapshot); - RETURN NULL; -END; -$$ LANGUAGE plpgsql; ---> statement-breakpoint -CREATE FUNCTION "conditions".federation_record_capture() RETURNS trigger AS $$ -BEGIN - IF NOT "conditions".federation_is_own(NEW.record, NEW.access_mode) THEN - RETURN NULL; - END IF; - IF NEW.tombstoned_at IS NOT NULL THEN - IF TG_OP = 'UPDATE' AND (OLD.tombstoned_at IS NULL - OR OLD.tombstone_reason IS DISTINCT FROM NEW.tombstone_reason) THEN - PERFORM "conditions".federation_journal_tombstone(TG_TABLE_NAME, NEW); - END IF; - RETURN NULL; - END IF; - IF NOT "conditions".federation_wants(TG_TABLE_NAME) THEN - RETURN NULL; - END IF; - IF TG_OP = 'UPDATE' AND OLD.tombstoned_at IS NULL AND OLD.revision = NEW.revision THEN - RETURN NULL; - END IF; - INSERT INTO "conditions"."federation_outbox" - (operation, record_class, record_id, canonical_id, kind, domain, snapshot) - VALUES ( - CASE WHEN TG_OP = 'INSERT' OR OLD.tombstoned_at IS NOT NULL THEN 'create' ELSE 'update' END, - TG_TABLE_NAME, NEW.id, NEW.canonical_id, NEW.kind, NEW.domain, NEW.record); - RETURN NULL; -END; -$$ LANGUAGE plpgsql; ---> statement-breakpoint -CREATE FUNCTION "conditions".federation_observation_capture() RETURNS trigger AS $$ -BEGIN - IF NEW.source_id = '@fused' OR NOT "conditions".federation_is_own(NEW.record, NEW.access_mode) - OR NOT EXISTS ( - SELECT 1 FROM "conditions"."federation_subscription" s - WHERE s.filter -> 'properties' ? NEW.property - AND (NOT (s.filter ? 'classes') OR s.filter -> 'classes' ? 'observation')) THEN - RETURN NULL; - END IF; - IF TG_OP = 'UPDATE' AND OLD.record = NEW.record THEN - RETURN NULL; - END IF; - INSERT INTO "conditions"."federation_outbox" - (operation, record_class, record_id, canonical_id, kind, domain, property, snapshot) - VALUES ( - CASE TG_OP WHEN 'INSERT' THEN 'create' ELSE 'update' END, - 'observation', NEW.record ->> 'id', NEW.record ->> 'canonicalId', 'observation', - NEW.record ->> 'domain', NEW.property, NEW.record); - RETURN NULL; -END; -$$ LANGUAGE plpgsql; ---> statement-breakpoint -CREATE TRIGGER federation_capture AFTER INSERT OR UPDATE ON "conditions"."situation" - FOR EACH ROW EXECUTE FUNCTION "conditions".federation_situation_capture(); ---> statement-breakpoint -CREATE TRIGGER federation_capture AFTER INSERT OR UPDATE ON "conditions"."feature" - FOR EACH ROW EXECUTE FUNCTION "conditions".federation_record_capture(); ---> statement-breakpoint -CREATE TRIGGER federation_capture AFTER INSERT OR UPDATE ON "conditions"."offer" - FOR EACH ROW EXECUTE FUNCTION "conditions".federation_record_capture(); ---> statement-breakpoint -CREATE TRIGGER federation_capture AFTER INSERT OR UPDATE ON "conditions"."observation_latest" - FOR EACH ROW EXECUTE FUNCTION "conditions".federation_observation_capture(); diff --git a/packages/core/drizzle/0049_peer_scoped_erasure.sql b/packages/core/drizzle/0049_peer_scoped_erasure.sql deleted file mode 100644 index f9c7cec5d..000000000 --- a/packages/core/drizzle/0049_peer_scoped_erasure.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE "conditions"."federation_tombstone" ADD COLUMN "peer_instance_id" text DEFAULT '' NOT NULL;--> statement-breakpoint -ALTER TABLE "conditions"."federation_tombstone" DROP CONSTRAINT "federation_tombstone_pkey";--> statement-breakpoint -ALTER TABLE "conditions"."federation_tombstone" ADD CONSTRAINT "federation_tombstone_canonical_id_peer_instance_id_pk" PRIMARY KEY("canonical_id","peer_instance_id"); diff --git a/packages/core/drizzle/0050_retire_legacy_flow_tables.sql b/packages/core/drizzle/0050_retire_legacy_flow_tables.sql deleted file mode 100644 index 25ad1cb9e..000000000 --- a/packages/core/drizzle/0050_retire_legacy_flow_tables.sql +++ /dev/null @@ -1,20 +0,0 @@ -ALTER TABLE "conditions"."observations" DISABLE ROW LEVEL SECURITY;--> statement-breakpoint -ALTER TABLE "conditions"."sensor_speed_hourly" DISABLE ROW LEVEL SECURITY;--> statement-breakpoint -ALTER TABLE "conditions"."sensor_speed_sample" DISABLE ROW LEVEL SECURITY;--> statement-breakpoint -ALTER TABLE "conditions"."speed_rollup_progress" DISABLE ROW LEVEL SECURITY;--> statement-breakpoint -DROP TABLE "conditions"."observations" CASCADE;--> statement-breakpoint -DROP TABLE "conditions"."sensor_speed_hourly" CASCADE;--> statement-breakpoint -DROP TABLE "conditions"."sensor_speed_sample" CASCADE;--> statement-breakpoint -DROP TABLE "conditions"."speed_rollup_progress" CASCADE;--> statement-breakpoint --- Hand-ordered: drizzle-kit adds the new primary key before its column and a --- second primary key beside the old one. The rows are derived (baselines and --- snaps are recomputed from the new series), so they are cleared rather than --- re-keyed. -DELETE FROM "conditions"."sensor_baseline";--> statement-breakpoint -DELETE FROM "conditions"."sensor_segment";--> statement-breakpoint -ALTER TABLE "conditions"."sensor_baseline" DROP CONSTRAINT "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk";--> statement-breakpoint -ALTER TABLE "conditions"."sensor_baseline" DROP COLUMN "sensor_key";--> statement-breakpoint -ALTER TABLE "conditions"."sensor_baseline" ADD COLUMN "subject_key" text NOT NULL;--> statement-breakpoint -ALTER TABLE "conditions"."sensor_baseline" ADD CONSTRAINT "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk" PRIMARY KEY("subject_key","dow_bucket","tod_bucket","method");--> statement-breakpoint -ALTER TABLE "conditions"."sensor_segment" DROP COLUMN "sensor_key";--> statement-breakpoint -ALTER TABLE "conditions"."sensor_segment" ADD COLUMN "subject_key" text PRIMARY KEY NOT NULL; diff --git a/packages/core/drizzle/0051_canonical_components_crowd_evidence.sql b/packages/core/drizzle/0051_canonical_components_crowd_evidence.sql deleted file mode 100644 index 4dfbf9dcc..000000000 --- a/packages/core/drizzle/0051_canonical_components_crowd_evidence.sql +++ /dev/null @@ -1,7 +0,0 @@ -ALTER TABLE "conditions"."observation_latest" ADD COLUMN "evidence_state" text;--> statement-breakpoint -ALTER TABLE "conditions"."observation_latest" ADD COLUMN "confidence_score" double precision;--> statement-breakpoint -ALTER TABLE "conditions"."observation_latest" ADD COLUMN "corroborations" integer DEFAULT 0 NOT NULL;--> statement-breakpoint -ALTER TABLE "conditions"."feature_canonical" ADD COLUMN "components" jsonb DEFAULT '[]'::jsonb NOT NULL;--> statement-breakpoint -CREATE INDEX "idx_observation_latest_crowd_record" ON "conditions"."observation_latest" USING btree (("record" ->> 'id')) WHERE "conditions"."observation_latest"."source_id" = 'crowd';--> statement-breakpoint -CREATE INDEX "idx_feature_external_ids" ON "conditions"."feature" USING gin (("record" -> 'externalIds') jsonb_path_ops);--> statement-breakpoint -ALTER TABLE "conditions"."observation_latest" ADD CONSTRAINT "observation_latest_evidence_state_enum" CHECK (evidence_state IS NULL OR "evidence_state" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')); \ No newline at end of file diff --git a/packages/core/drizzle/0052_crowd_observations_stay_local.sql b/packages/core/drizzle/0052_crowd_observations_stay_local.sql deleted file mode 100644 index 5bcffafb9..000000000 --- a/packages/core/drizzle/0052_crowd_observations_stay_local.sql +++ /dev/null @@ -1,26 +0,0 @@ --- A crowd observation stays on the instance that landed it, as a fused row --- does: its subject is this instance's canonical feature, a cluster of the --- feature links no peer holds, so the reading would name nothing there. --- drizzle-kit cannot model functions, so the DDL is authored here. -CREATE OR REPLACE FUNCTION "conditions".federation_observation_capture() RETURNS trigger AS $$ -BEGIN - IF NEW.source_id IN ('@fused', 'crowd') - OR NOT "conditions".federation_is_own(NEW.record, NEW.access_mode) - OR NOT EXISTS ( - SELECT 1 FROM "conditions"."federation_subscription" s - WHERE s.filter -> 'properties' ? NEW.property - AND (NOT (s.filter ? 'classes') OR s.filter -> 'classes' ? 'observation')) THEN - RETURN NULL; - END IF; - IF TG_OP = 'UPDATE' AND OLD.record = NEW.record THEN - RETURN NULL; - END IF; - INSERT INTO "conditions"."federation_outbox" - (operation, record_class, record_id, canonical_id, kind, domain, property, snapshot) - VALUES ( - CASE TG_OP WHEN 'INSERT' THEN 'create' ELSE 'update' END, - 'observation', NEW.record ->> 'id', NEW.record ->> 'canonicalId', 'observation', - NEW.record ->> 'domain', NEW.property, NEW.record); - RETURN NULL; -END; -$$ LANGUAGE plpgsql; diff --git a/packages/core/drizzle/0053_clear_latest_readings.sql b/packages/core/drizzle/0053_clear_latest_readings.sql deleted file mode 100644 index 887f2c5a3..000000000 --- a/packages/core/drizzle/0053_clear_latest_readings.sql +++ /dev/null @@ -1,7 +0,0 @@ --- The latest readings are about to keep only what varies per reading, next to --- their series template. No instance holds data yet, so the rows of the old --- shape go rather than being converted, with the history keyed to them; the --- next poll writes every series again. -DELETE FROM "conditions"."observation"; ---> statement-breakpoint -DELETE FROM "conditions"."observation_latest"; diff --git a/packages/core/drizzle/0054_compact_latest_readings.sql b/packages/core/drizzle/0054_compact_latest_readings.sql deleted file mode 100644 index 096ce8703..000000000 --- a/packages/core/drizzle/0054_compact_latest_readings.sql +++ /dev/null @@ -1,5 +0,0 @@ -DROP INDEX "conditions"."idx_observation_latest_crowd_record";--> statement-breakpoint -ALTER TABLE "conditions"."observation_latest" ADD COLUMN "reading" jsonb NOT NULL;--> statement-breakpoint -ALTER TABLE "conditions"."observation_latest" ADD COLUMN "template_hash" text NOT NULL;--> statement-breakpoint -CREATE INDEX "idx_observation_latest_crowd_record" ON "conditions"."observation_latest" USING btree (("reading" ->> 'id')) WHERE "conditions"."observation_latest"."source_id" = 'crowd';--> statement-breakpoint -ALTER TABLE "conditions"."observation_latest" DROP COLUMN "record"; \ No newline at end of file diff --git a/packages/core/drizzle/0055_latest_template_out_of_line.sql b/packages/core/drizzle/0055_latest_template_out_of_line.sql deleted file mode 100644 index e354f8498..000000000 --- a/packages/core/drizzle/0055_latest_template_out_of_line.sql +++ /dev/null @@ -1,52 +0,0 @@ --- A latest row keeps its reading inline and its series template out of --- line: a row grows past the tuple target only by its template (about a --- kilobyte), whose storage EXTERNAL moves it to the TOAST table, and an --- update that keeps it carries only its pointer; the reading's storage MAIN --- keeps it in the row, so an update writes no TOAST entry. Rows of about a --- kilobyte leave room on their page for heap-only updates. A flow source --- rewrites tens of thousands of readings a minute; the template changes when --- the site does. drizzle-kit cannot model storage parameters or functions, so --- the DDL is authored here. -ALTER TABLE "conditions"."observation_latest" ALTER COLUMN "template" SET STORAGE EXTERNAL; ---> statement-breakpoint -ALTER TABLE "conditions"."observation_latest" ALTER COLUMN "reading" SET STORAGE MAIN; ---> statement-breakpoint -ALTER TABLE "conditions"."observation_latest" SET (toast_tuple_target = 1200, fillfactor = 50); ---> statement-breakpoint --- The stored observation a latest row holds: its series template with the --- reading's own fields, provenance merged (`recordOf` in code). -CREATE FUNCTION "conditions".observation_record(template jsonb, reading jsonb) RETURNS jsonb AS $$ - SELECT (template - 'namespace' - 'provenance') || (reading - 'provenance') - || jsonb_build_object('provenance', - (template -> 'provenance') || COALESCE(reading -> 'provenance', '{}'::jsonb)) -$$ LANGUAGE sql IMMUTABLE; ---> statement-breakpoint -CREATE OR REPLACE FUNCTION "conditions".federation_observation_capture() RETURNS trigger AS $$ -DECLARE - rec jsonb; -BEGIN - -- Cheapest first: the template is out of line, and a flow poll updates a - -- hundred thousand rows no subscription asks for. - IF NEW.source_id IN ('@fused', 'crowd') - OR NOT EXISTS ( - SELECT 1 FROM "conditions"."federation_subscription" s - WHERE s.filter -> 'properties' ? NEW.property - AND (NOT (s.filter ? 'classes') OR s.filter -> 'classes' ? 'observation')) THEN - RETURN NULL; - END IF; - IF TG_OP = 'UPDATE' AND OLD.reading = NEW.reading AND OLD.template_hash = NEW.template_hash THEN - RETURN NULL; - END IF; - IF NOT "conditions".federation_is_own(NEW.template, NEW.access_mode) THEN - RETURN NULL; - END IF; - rec := "conditions".observation_record(NEW.template, NEW.reading); - INSERT INTO "conditions"."federation_outbox" - (operation, record_class, record_id, canonical_id, kind, domain, property, snapshot) - VALUES ( - CASE TG_OP WHEN 'INSERT' THEN 'create' ELSE 'update' END, - 'observation', rec ->> 'id', rec ->> 'canonicalId', 'observation', - rec ->> 'domain', NEW.property, rec); - RETURN NULL; -END; -$$ LANGUAGE plpgsql; diff --git a/packages/core/drizzle/0056_drop_history_time_index.sql b/packages/core/drizzle/0056_drop_history_time_index.sql deleted file mode 100644 index 7cf1513d3..000000000 --- a/packages/core/drizzle/0056_drop_history_time_index.sql +++ /dev/null @@ -1,8 +0,0 @@ --- History is read by series through the primary key (it leads with --- series_id) and dropped a partition at a time; only the hourly rollup reads --- by time alone, an hour of a day partition. Readings arrive roughly in time --- order, so a block range index serves that read for a few pages a --- partition, where a btree on time took about a fifth of every row's bytes. -DROP INDEX IF EXISTS "conditions"."idx_observation_start"; ---> statement-breakpoint -CREATE INDEX "idx_observation_start_brin" ON "conditions"."observation" USING brin ("phenomenon_start"); diff --git a/packages/core/drizzle/0057_crowd_record_id.sql b/packages/core/drizzle/0057_crowd_record_id.sql deleted file mode 100644 index 92d288bff..000000000 --- a/packages/core/drizzle/0057_crowd_record_id.sql +++ /dev/null @@ -1,3 +0,0 @@ -DROP INDEX "conditions"."idx_observation_latest_crowd_record";--> statement-breakpoint -ALTER TABLE "conditions"."observation_latest" ADD COLUMN "crowd_record_id" text;--> statement-breakpoint -CREATE INDEX "idx_observation_latest_crowd_record" ON "conditions"."observation_latest" USING btree ("crowd_record_id") WHERE "conditions"."observation_latest"."crowd_record_id" IS NOT NULL; \ No newline at end of file diff --git a/packages/core/drizzle/0058_latest_source_index.sql b/packages/core/drizzle/0058_latest_source_index.sql deleted file mode 100644 index cb21e3d5f..000000000 --- a/packages/core/drizzle/0058_latest_source_index.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP INDEX "conditions"."idx_observation_latest_property";--> statement-breakpoint -CREATE INDEX "idx_observation_latest_source" ON "conditions"."observation_latest" USING btree ("source_id"); \ No newline at end of file diff --git a/packages/core/drizzle/0059_archive_erasure.sql b/packages/core/drizzle/0059_archive_erasure.sql deleted file mode 100644 index 3e7534516..000000000 --- a/packages/core/drizzle/0059_archive_erasure.sql +++ /dev/null @@ -1,4 +0,0 @@ -CREATE TABLE "conditions"."archive_erasure" ( - "key" text PRIMARY KEY NOT NULL, - "applied_at" timestamp with time zone DEFAULT now() NOT NULL -); diff --git a/packages/core/drizzle/0060_feed_catalog.sql b/packages/core/drizzle/0060_feed_catalog.sql deleted file mode 100644 index ac6c89235..000000000 --- a/packages/core/drizzle/0060_feed_catalog.sql +++ /dev/null @@ -1,4 +0,0 @@ -ALTER TABLE "conditions"."source" DROP CONSTRAINT "source_produces_enum";--> statement-breakpoint -ALTER TABLE "conditions"."source" ALTER COLUMN "country" DROP NOT NULL;--> statement-breakpoint -ALTER TABLE "conditions"."source" ADD COLUMN "product" text NOT NULL;--> statement-breakpoint -ALTER TABLE "conditions"."source" DROP COLUMN "produces"; \ No newline at end of file diff --git a/packages/core/drizzle/0061_operator_scope_fusion_federation.sql b/packages/core/drizzle/0061_operator_scope_fusion_federation.sql deleted file mode 100644 index 9334f536b..000000000 --- a/packages/core/drizzle/0061_operator_scope_fusion_federation.sql +++ /dev/null @@ -1,41 +0,0 @@ -CREATE TABLE "conditions"."on_demand_fetch" ( - "source_id" text NOT NULL, - "cell" text NOT NULL, - "fetched_at" timestamp with time zone, - "expires_at" timestamp with time zone, - "status" text NOT NULL, - "retry_at" timestamp with time zone, - "claimed_until" timestamp with time zone, - CONSTRAINT "on_demand_fetch_source_id_cell_pk" PRIMARY KEY("source_id","cell"), - CONSTRAINT "on_demand_fetch_status_enum" CHECK ("conditions"."on_demand_fetch"."status" IN ('pending','fresh','failed')) -); ---> statement-breakpoint -CREATE TABLE "conditions"."on_demand_quota" ( - "source_id" text PRIMARY KEY NOT NULL, - "tokens" real NOT NULL, - "refilled_at" timestamp with time zone NOT NULL, - "day" date NOT NULL, - "day_count" integer NOT NULL -); ---> statement-breakpoint -DROP INDEX "conditions"."idx_observation_latest_source";--> statement-breakpoint -DROP INDEX "conditions"."idx_feature_source";--> statement-breakpoint -DROP INDEX "conditions"."idx_offer_source";--> statement-breakpoint -DROP INDEX "conditions"."idx_situation_source";--> statement-breakpoint -ALTER TABLE "conditions"."observation_latest" ADD COLUMN "fused_sources" text[];--> statement-breakpoint -ALTER TABLE "conditions"."observation_latest" ADD COLUMN "fused_public" boolean;--> statement-breakpoint -ALTER TABLE "conditions"."feature" ADD COLUMN "created_at" timestamp with time zone DEFAULT now() NOT NULL;--> statement-breakpoint -ALTER TABLE "conditions"."offer" ADD COLUMN "created_at" timestamp with time zone DEFAULT now() NOT NULL;--> statement-breakpoint -ALTER TABLE "conditions"."situation" ADD COLUMN "created_at" timestamp with time zone DEFAULT now() NOT NULL;--> statement-breakpoint -ALTER TABLE "conditions"."segment_profile" ADD COLUMN "contributing" text[] DEFAULT '{}'::text[] NOT NULL;--> statement-breakpoint -ALTER TABLE "conditions"."source" ADD COLUMN "restricted" boolean DEFAULT false NOT NULL;--> statement-breakpoint -ALTER TABLE "conditions"."source" ADD COLUMN "restricted_since" timestamp with time zone;--> statement-breakpoint -ALTER TABLE "conditions"."source" ADD COLUMN "fusion_restricted" boolean;--> statement-breakpoint -ALTER TABLE "conditions"."source" ADD COLUMN "fusion_tier" text;--> statement-breakpoint -ALTER TABLE "conditions"."source" ADD COLUMN "fusion_licenses" text;--> statement-breakpoint -ALTER TABLE "conditions"."source" ADD COLUMN "federation_restricted" boolean;--> statement-breakpoint -ALTER TABLE "conditions"."source" ADD COLUMN "federation_pending" boolean DEFAULT false NOT NULL;--> statement-breakpoint -CREATE INDEX "idx_observation_latest_source" ON "conditions"."observation_latest" USING btree ("source_id","series_id");--> statement-breakpoint -CREATE INDEX "idx_feature_source" ON "conditions"."feature" USING btree ("source_id","id");--> statement-breakpoint -CREATE INDEX "idx_offer_source" ON "conditions"."offer" USING btree ("source_id","id");--> statement-breakpoint -CREATE INDEX "idx_situation_source" ON "conditions"."situation" USING btree ("source_id","id"); \ No newline at end of file diff --git a/packages/core/drizzle/0062_federation_capture.sql b/packages/core/drizzle/0062_federation_capture.sql deleted file mode 100644 index 8d1e0ba20..000000000 --- a/packages/core/drizzle/0062_federation_capture.sql +++ /dev/null @@ -1,163 +0,0 @@ --- What the outbox capture journals of this instance's records, and what it --- erases of a restricted source's. drizzle-kit cannot model functions or --- triggers, so the DDL is authored here. --- --- A restricted source's records never leave the instance, as an on-demand --- answer or a peer's record does not: the capture skips their creates and --- updates, since none of their content may be journalled. -CREATE FUNCTION "conditions".federation_may_carry(rec jsonb, access_mode text, src text) -RETURNS boolean AS $$ - SELECT "conditions".federation_is_own(rec, access_mode) - AND NOT EXISTS ( - SELECT 1 FROM "conditions"."source" s WHERE s.id = src AND s.restricted) -$$ LANGUAGE sql STABLE; ---> statement-breakpoint --- A situation's journalled snapshot and priority, shared by the capture and --- the boot's reconcile of a source turned public, so both journal the same --- entry. -CREATE FUNCTION "conditions".federation_situation_snapshot(s "conditions"."situation") -RETURNS jsonb AS $$ - SELECT CASE WHEN s.evidence_state IS NULL THEN s.record - ELSE s.record || jsonb_build_object('evidence', jsonb_build_object( - 'state', s.evidence_state, - 'confidenceScore', s.confidence_score, - 'routingEligible', s.routing_eligible, - 'corroborations', s.corroborations)) END -$$ LANGUAGE sql STABLE; ---> statement-breakpoint --- Priority: what closes a road, all its lanes, or is an incident. -CREATE FUNCTION "conditions".federation_situation_priority(kind text, rec jsonb) -RETURNS boolean AS $$ - SELECT kind = 'incident' OR EXISTS ( - SELECT 1 FROM jsonb_array_elements(COALESCE(rec -> 'effects', '[]'::jsonb)) e - WHERE e ->> 'kind' = 'closure' - OR (e ->> 'kind' = 'lane_restriction' AND e ->> 'vehicleImpact' = 'all_lanes_closed')) -$$ LANGUAGE sql IMMUTABLE; ---> statement-breakpoint --- Whether a peer may hold this instance's record `rec_id`, of a source now --- restricted: it has outbox entries, or a subscription wants its class and --- it was stored by the time its source last turned restricted (entries a --- peer pulled while the source was public may since have been pruned). A --- record stored since its source turned restricted, or of a source --- restricted since it was added, never reached a peer: nothing of it, not --- even a delete, is journalled. -CREATE FUNCTION "conditions".federation_was_shared( - cls text, rec_id text, rec_created_at timestamptz, src text) -RETURNS boolean AS $$ - SELECT EXISTS ( - SELECT 1 FROM "conditions"."federation_outbox" o - WHERE o.record_class = cls AND o.record_id = rec_id) - OR ("conditions".federation_wants(cls) AND EXISTS ( - SELECT 1 FROM "conditions"."source" s - WHERE s.id = src AND (NOT s.restricted OR rec_created_at <= s.restricted_since))) -$$ LANGUAGE sql STABLE; ---> statement-breakpoint --- An erasure of a restricted source's own record still erases what a peer --- may hold of it, and goes out as a delete (which carries no content), so a --- subscriber erases its copy too; a record no peer can hold journals nothing. -CREATE OR REPLACE FUNCTION "conditions".federation_situation_capture() RETURNS trigger AS $$ -BEGIN - IF NOT "conditions".federation_may_carry(NEW.record, NEW.access_mode, NEW.source_id) THEN - IF TG_OP = 'UPDATE' AND NEW.tombstone_reason = 'rights_revoked' - AND OLD.tombstone_reason IS DISTINCT FROM 'rights_revoked' - AND "conditions".federation_is_own(NEW.record, NEW.access_mode) - AND "conditions".federation_was_shared('situation', NEW.id, NEW.created_at, NEW.source_id) THEN - PERFORM "conditions".federation_journal_tombstone('situation', NEW); - END IF; - RETURN NULL; - END IF; - IF NEW.tombstoned_at IS NOT NULL THEN - IF TG_OP = 'UPDATE' AND (OLD.tombstoned_at IS NULL - OR OLD.tombstone_reason IS DISTINCT FROM NEW.tombstone_reason) THEN - PERFORM "conditions".federation_journal_tombstone('situation', NEW); - END IF; - RETURN NULL; - END IF; - IF NOT "conditions".federation_wants('situation') THEN - RETURN NULL; - END IF; - -- A change is a new revision, or new evidence on a crowd report (whose - -- lifetime is part of its evidence). An expiry a feed poll slides along - -- changes neither. - IF TG_OP = 'UPDATE' AND OLD.tombstoned_at IS NULL AND OLD.revision = NEW.revision - AND OLD.evidence_state IS NOT DISTINCT FROM NEW.evidence_state - AND OLD.confidence_score IS NOT DISTINCT FROM NEW.confidence_score - AND OLD.routing_eligible = NEW.routing_eligible - AND OLD.corroborations = NEW.corroborations - AND (NEW.origin <> 'crowd' OR OLD.expires_at IS NOT DISTINCT FROM NEW.expires_at) THEN - RETURN NULL; - END IF; - INSERT INTO "conditions"."federation_outbox" - (operation, record_class, record_id, canonical_id, kind, domain, priority, snapshot) - VALUES ( - CASE WHEN TG_OP = 'INSERT' OR OLD.tombstoned_at IS NOT NULL THEN 'create' ELSE 'update' END, - 'situation', NEW.id, NEW.canonical_id, NEW.kind, NEW.domain, - "conditions".federation_situation_priority(NEW.kind, NEW.record), - "conditions".federation_situation_snapshot(NEW)); - RETURN NULL; -END; -$$ LANGUAGE plpgsql; ---> statement-breakpoint -CREATE OR REPLACE FUNCTION "conditions".federation_record_capture() RETURNS trigger AS $$ -BEGIN - IF NOT "conditions".federation_may_carry(NEW.record, NEW.access_mode, NEW.source_id) THEN - IF TG_OP = 'UPDATE' AND NEW.tombstone_reason = 'rights_revoked' - AND OLD.tombstone_reason IS DISTINCT FROM 'rights_revoked' - AND "conditions".federation_is_own(NEW.record, NEW.access_mode) - AND "conditions".federation_was_shared(TG_TABLE_NAME, NEW.id, NEW.created_at, NEW.source_id) THEN - PERFORM "conditions".federation_journal_tombstone(TG_TABLE_NAME, NEW); - END IF; - RETURN NULL; - END IF; - IF NEW.tombstoned_at IS NOT NULL THEN - IF TG_OP = 'UPDATE' AND (OLD.tombstoned_at IS NULL - OR OLD.tombstone_reason IS DISTINCT FROM NEW.tombstone_reason) THEN - PERFORM "conditions".federation_journal_tombstone(TG_TABLE_NAME, NEW); - END IF; - RETURN NULL; - END IF; - IF NOT "conditions".federation_wants(TG_TABLE_NAME) THEN - RETURN NULL; - END IF; - IF TG_OP = 'UPDATE' AND OLD.tombstoned_at IS NULL AND OLD.revision = NEW.revision THEN - RETURN NULL; - END IF; - INSERT INTO "conditions"."federation_outbox" - (operation, record_class, record_id, canonical_id, kind, domain, snapshot) - VALUES ( - CASE WHEN TG_OP = 'INSERT' OR OLD.tombstoned_at IS NOT NULL THEN 'create' ELSE 'update' END, - TG_TABLE_NAME, NEW.id, NEW.canonical_id, NEW.kind, NEW.domain, NEW.record); - RETURN NULL; -END; -$$ LANGUAGE plpgsql; ---> statement-breakpoint --- Fused rows, full and public, stay on the instance that computed them. -CREATE OR REPLACE FUNCTION "conditions".federation_observation_capture() RETURNS trigger AS $$ -DECLARE - rec jsonb; -BEGIN - -- Cheapest first: the template is out of line, and a flow poll updates a - -- hundred thousand rows no subscription asks for. - IF NEW.source_id IN ('@fused', '@fused-public', 'crowd') - OR NOT EXISTS ( - SELECT 1 FROM "conditions"."federation_subscription" s - WHERE s.filter -> 'properties' ? NEW.property - AND (NOT (s.filter ? 'classes') OR s.filter -> 'classes' ? 'observation')) THEN - RETURN NULL; - END IF; - IF TG_OP = 'UPDATE' AND OLD.reading = NEW.reading AND OLD.template_hash = NEW.template_hash THEN - RETURN NULL; - END IF; - IF NOT "conditions".federation_may_carry(NEW.template, NEW.access_mode, NEW.source_id) THEN - RETURN NULL; - END IF; - rec := "conditions".observation_record(NEW.template, NEW.reading); - INSERT INTO "conditions"."federation_outbox" - (operation, record_class, record_id, canonical_id, kind, domain, property, snapshot) - VALUES ( - CASE TG_OP WHEN 'INSERT' THEN 'create' ELSE 'update' END, - 'observation', rec ->> 'id', rec ->> 'canonicalId', 'observation', - rec ->> 'domain', NEW.property, rec); - RETURN NULL; -END; -$$ LANGUAGE plpgsql; diff --git a/packages/core/drizzle/0063_federation_source_receipt.sql b/packages/core/drizzle/0063_federation_source_receipt.sql deleted file mode 100644 index e0d067614..000000000 --- a/packages/core/drizzle/0063_federation_source_receipt.sql +++ /dev/null @@ -1,6 +0,0 @@ -CREATE TABLE "conditions"."federation_source_receipt" ( - "peer_instance_id" text NOT NULL, - "source_id" text NOT NULL, - "last_received_at" timestamp with time zone NOT NULL, - CONSTRAINT "federation_source_receipt_peer_instance_id_source_id_pk" PRIMARY KEY("peer_instance_id","source_id") -); diff --git a/packages/core/drizzle/0064_observation_latest_effective.sql b/packages/core/drizzle/0064_observation_latest_effective.sql deleted file mode 100644 index 66899f314..000000000 --- a/packages/core/drizzle/0064_observation_latest_effective.sql +++ /dev/null @@ -1 +0,0 @@ -CREATE INDEX "idx_observation_latest_effective_brin" ON "conditions"."observation_latest" USING brin ("effective_from"); \ No newline at end of file diff --git a/packages/core/drizzle/0065_canonical_members_direct.sql b/packages/core/drizzle/0065_canonical_members_direct.sql deleted file mode 100644 index 19dc5c92b..000000000 --- a/packages/core/drizzle/0065_canonical_members_direct.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP INDEX "conditions"."idx_feature_canonical_members";--> statement-breakpoint -CREATE INDEX "idx_feature_canonical_members" ON "conditions"."feature_canonical" USING gin ("member_ids") WITH (fastupdate=off); \ No newline at end of file diff --git a/packages/core/drizzle/0066_feature_external_ids_direct.sql b/packages/core/drizzle/0066_feature_external_ids_direct.sql deleted file mode 100644 index 3a87645ff..000000000 --- a/packages/core/drizzle/0066_feature_external_ids_direct.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP INDEX "conditions"."idx_feature_external_ids";--> statement-breakpoint -CREATE INDEX "idx_feature_external_ids" ON "conditions"."feature" USING gin (("record" -> 'externalIds') jsonb_path_ops) WITH (fastupdate=off); \ No newline at end of file diff --git a/packages/core/drizzle/0067_feature_link_code_point_order.sql b/packages/core/drizzle/0067_feature_link_code_point_order.sql deleted file mode 100644 index 29e095307..000000000 --- a/packages/core/drizzle/0067_feature_link_code_point_order.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE "conditions"."feature_link" DROP CONSTRAINT "feature_link_ordered";--> statement-breakpoint -ALTER TABLE "conditions"."feature_link" ADD CONSTRAINT "feature_link_ordered" CHECK ("conditions"."feature_link"."a_id" < "conditions"."feature_link"."b_id" COLLATE "C"); \ No newline at end of file diff --git a/packages/core/drizzle/0068_flow_field_lineage.sql b/packages/core/drizzle/0068_flow_field_lineage.sql deleted file mode 100644 index a3c7fc341..000000000 --- a/packages/core/drizzle/0068_flow_field_lineage.sql +++ /dev/null @@ -1,114 +0,0 @@ -CREATE TABLE "conditions"."contributor_receipt" ( - "id" text PRIMARY KEY NOT NULL, - "version" smallint NOT NULL, - "contributors" jsonb NOT NULL, - "created_at" timestamp with time zone DEFAULT now() NOT NULL -); ---> statement-breakpoint -ALTER TABLE "conditions"."observation_latest" ADD COLUMN "contributor_receipt_id" text;--> statement-breakpoint -ALTER TABLE "conditions"."segment_observation" ADD COLUMN "native_field_sources" jsonb;--> statement-breakpoint -ALTER TABLE "conditions"."segment_observation" ADD COLUMN "field_sources" jsonb;--> statement-breakpoint -ALTER TABLE "conditions"."segment_observation" ADD COLUMN "field_contributors" jsonb;--> statement-breakpoint -ALTER TABLE "conditions"."segment_observation" ADD COLUMN "field_lineage_complete" jsonb;--> statement-breakpoint -ALTER TABLE "conditions"."segment_speed" ADD COLUMN "native_field_sources" jsonb;--> statement-breakpoint -ALTER TABLE "conditions"."segment_speed" ADD COLUMN "field_sources" jsonb;--> statement-breakpoint -ALTER TABLE "conditions"."segment_speed" ADD COLUMN "field_contributors" jsonb;--> statement-breakpoint -ALTER TABLE "conditions"."segment_speed" ADD COLUMN "field_lineage_complete" jsonb;--> statement-breakpoint -ALTER TABLE "conditions"."source" ADD COLUMN "credit_name" text;--> statement-breakpoint -ALTER TABLE "conditions"."source" ADD COLUMN "credit_url" text;--> statement-breakpoint -ALTER TABLE "conditions"."source" ADD COLUMN "credit_notice" text; ---> statement-breakpoint --- Native identity remains in rights/contributing; display identity follows the parent. --- Capture these arrays when the measurement is written, never at feature rendering. -CREATE FUNCTION conditions.flow_credit(native_source text, supplied jsonb DEFAULT '{}'::jsonb) -RETURNS jsonb LANGUAGE sql STABLE PARALLEL SAFE AS $$ - WITH RECURSIVE ancestry AS ( - SELECT s.*, ARRAY[s.id] AS path FROM conditions.source s WHERE s.id = COALESCE(NULLIF(supplied->>'parentSourceId',''), native_source) - UNION ALL - SELECT s.*, a.path || s.id FROM ancestry a JOIN conditions.source s ON s.id = a.parent_source_id - WHERE NULLIF(supplied->>'parentSourceId','') IS NULL AND NOT s.id = ANY(a.path) - ), publisher AS ( - SELECT * FROM ancestry ORDER BY cardinality(path) DESC LIMIT 1 - ), identity AS ( - SELECT COALESCE(NULLIF(supplied->>'parentSourceId',''), - (SELECT COALESCE(parent_source_id, id) FROM publisher), native_source) AS id - ), credits AS ( - SELECT 0 AS ord, jsonb_strip_nulls(jsonb_build_object( - 'sourceId', identity.id, - 'name', COALESCE(supplied->>'name', p.credit_name, supplied->>'provider', p.operator, native_source), - 'url', COALESCE(p.credit_url, supplied->>'url'), - 'spdxLicense', COALESCE(supplied->>'license', p.license), - 'licenseUrl', COALESCE(supplied->>'licenseUrl', p.license_url), - 'attributionText', COALESCE(supplied->>'provider', p.attribution), - 'publisher', CASE WHEN p.operator IS NOT NULL THEN jsonb_build_object('name', p.operator) END - )) AS credit FROM identity LEFT JOIN publisher p ON true - UNION ALL - SELECT 1, jsonb_build_object('sourceId', identity.id, 'name', a.credit_notice) - FROM (SELECT credit_notice FROM ancestry UNION ALL - SELECT credit_notice FROM conditions.source WHERE id = native_source AND parent_source_id = NULLIF(supplied->>'parentSourceId','')) a CROSS JOIN identity WHERE a.credit_notice IS NOT NULL AND a.credit_notice <> '' - ) SELECT COALESCE(jsonb_agg(credit ORDER BY ord, credit::text), '[]'::jsonb) - FROM (SELECT DISTINCT ord, credit FROM credits) c; -$$; ---> statement-breakpoint -CREATE FUNCTION conditions.flow_credit_union(credits jsonb) -RETURNS jsonb LANGUAGE sql IMMUTABLE PARALLEL SAFE AS $$ - SELECT COALESCE(jsonb_agg(value ORDER BY value::text), '[]'::jsonb) - FROM (SELECT DISTINCT flat.value FROM jsonb_array_elements(COALESCE(credits, '[]'::jsonb)) entry - CROSS JOIN LATERAL jsonb_array_elements(CASE WHEN jsonb_typeof(entry.value) = 'array' - THEN entry.value ELSE jsonb_build_array(entry.value) END) flat - WHERE jsonb_typeof(flat.value) = 'object') c; -$$; ---> statement-breakpoint -CREATE FUNCTION conditions.flow_field_sources(fields jsonb) -RETURNS jsonb LANGUAGE sql IMMUTABLE PARALLEL SAFE AS $$ - SELECT jsonb_object_agg(key, ids) FROM ( - SELECT f.key, COALESCE(jsonb_agg(DISTINCT c.value->>'sourceId' ORDER BY c.value->>'sourceId') - FILTER (WHERE c.value->>'sourceId' IS NOT NULL), '[]'::jsonb) AS ids - FROM jsonb_each(fields) f LEFT JOIN LATERAL jsonb_array_elements(f.value) c ON true - GROUP BY f.key - ) values_by_field; -$$; ---> statement-breakpoint -CREATE FUNCTION conditions.flow_osm_credit() -RETURNS jsonb LANGUAGE sql IMMUTABLE PARALLEL SAFE AS $$ - SELECT '[{"sourceId":"openstreetmap","name":"OpenStreetMap","url":"https://www.openstreetmap.org/copyright","spdxLicense":"ODbL-1.0","attributionText":"© OpenStreetMap contributors"}]'::jsonb; -$$; ---> statement-breakpoint -CREATE FUNCTION conditions.flow_native_field_sources(fields jsonb, native_source text) -RETURNS jsonb LANGUAGE sql IMMUTABLE PARALLEL SAFE AS $$ - SELECT jsonb_object_agg(key, ids) FROM ( - SELECT f.key, COALESCE(jsonb_agg(DISTINCT CASE WHEN c.value->>'sourceId' = 'openstreetmap' - THEN 'openstreetmap' ELSE native_source END ORDER BY CASE WHEN c.value->>'sourceId' = 'openstreetmap' - THEN 'openstreetmap' ELSE native_source END) FILTER (WHERE c.value IS NOT NULL), '[]'::jsonb) AS ids - FROM jsonb_each(fields) f LEFT JOIN LATERAL jsonb_array_elements(f.value) c ON true GROUP BY f.key - ) values_by_field; -$$; ---> statement-breakpoint -CREATE FUNCTION conditions.flow_known_fields(fields jsonb) -RETURNS jsonb LANGUAGE sql IMMUTABLE PARALLEL SAFE AS $$ - SELECT COALESCE(jsonb_object_agg(key,value),'{}'::jsonb) FROM jsonb_each(fields) - WHERE jsonb_typeof(value) = 'array' AND jsonb_array_length(value) > 0; -$$; ---> statement-breakpoint --- Existing rows retain their valid values with null measurement lineage until a normal sweep. -CREATE OR REPLACE FUNCTION conditions.segment_flow(z integer, x integer, y integer, query_params json) -RETURNS bytea AS $$ -DECLARE bounds geometry := ST_TileEnvelope(z, x, y); mvt bytea; -BEGIN - SELECT ST_AsMVT(t, 'segment_flow', 4096, 'geom') INTO mvt FROM ( - SELECT s.segment_id, s.dir, s.highway, - sp.speed_ratio, sp.los, sp.confidence, sp.current_kph, sp.free_flow_kph, - 1 AS lineage_version, - COALESCE(sp.field_sources, jsonb_build_object('geometry', jsonb_build_array('openstreetmap')))::text AS field_sources, - COALESCE(sp.field_contributors, jsonb_build_object('geometry', conditions.flow_osm_credit()))::text AS field_contributors, - COALESCE(sp.field_lineage_complete, jsonb_build_object('geometry',true,'speed',sp.current_kph IS NULL,'freeFlow',sp.free_flow_kph IS NULL,'ratio',sp.speed_ratio IS NULL,'los',sp.los IS NULL,'confidence',sp.confidence IS NULL))::text AS field_lineage_complete, - ST_AsMVTGeom(ST_Transform(s.geom, 3857), bounds, 4096, 64, true) AS geom - FROM conditions.road_segment s - LEFT JOIN conditions.segment_speed sp ON sp.segment_id = s.segment_id - AND NOT EXISTS (SELECT 1 FROM conditions.source scope_source - WHERE scope_source.id = ANY(sp.contributing) AND scope_source.restricted) - WHERE s.min_zoom <= z AND s.geom && ST_Transform(bounds, 4326) - ) t WHERE t.geom IS NOT NULL; - RETURN COALESCE(mvt, ''::bytea); -END; -$$ LANGUAGE plpgsql STABLE STRICT PARALLEL SAFE; diff --git a/packages/core/drizzle/0069_captured_licensing.sql b/packages/core/drizzle/0069_captured_licensing.sql deleted file mode 100644 index 6aa71f76c..000000000 --- a/packages/core/drizzle/0069_captured_licensing.sql +++ /dev/null @@ -1,37 +0,0 @@ --- Scaffold and snapshot generated by drizzle-kit generate --custom --name=captured_licensing. --- PostgreSQL function bodies are custom SQL; no stored-data conversion or table changes. --- Captured scoped licence definitions travel with the selected measurement receipts. --- Permission selection still uses reviewed source IDs and rights. -CREATE OR REPLACE FUNCTION conditions.flow_credit(native_source text, supplied jsonb DEFAULT '{}'::jsonb) -RETURNS jsonb LANGUAGE sql STABLE PARALLEL SAFE AS $$ - WITH RECURSIVE ancestry AS ( - SELECT s.*, ARRAY[s.id] AS path FROM conditions.source s WHERE s.id = COALESCE(NULLIF(supplied->>'parentSourceId',''), native_source) - UNION ALL - SELECT s.*, a.path || s.id FROM ancestry a JOIN conditions.source s ON s.id = a.parent_source_id - WHERE NULLIF(supplied->>'parentSourceId','') IS NULL AND NOT s.id = ANY(a.path) - ), publisher AS ( - SELECT * FROM ancestry ORDER BY cardinality(path) DESC LIMIT 1 - ), identity AS ( - SELECT COALESCE(NULLIF(supplied->>'parentSourceId',''), - (SELECT COALESCE(parent_source_id, id) FROM publisher), native_source) AS id - ), credits AS ( - SELECT 0 AS ord, jsonb_strip_nulls(jsonb_build_object( - 'sourceId', identity.id, - 'name', COALESCE(supplied->>'name', p.credit_name, supplied->>'provider', p.operator, native_source), - 'url', COALESCE(p.credit_url, supplied->>'url'), - 'licensing', supplied->'licensing', - 'attributionText', COALESCE(supplied->>'provider', p.attribution), - 'publisher', CASE WHEN p.operator IS NOT NULL THEN jsonb_build_object('name', p.operator) END - )) AS credit FROM identity LEFT JOIN publisher p ON true - UNION ALL - SELECT 1, jsonb_build_object('sourceId', identity.id, 'name', a.credit_notice) - FROM (SELECT credit_notice FROM ancestry UNION ALL - SELECT credit_notice FROM conditions.source WHERE id = native_source AND parent_source_id = NULLIF(supplied->>'parentSourceId','')) a CROSS JOIN identity WHERE a.credit_notice IS NOT NULL AND a.credit_notice <> '' - ) SELECT COALESCE(jsonb_agg(credit ORDER BY ord, credit::text), '[]'::jsonb) - FROM (SELECT DISTINCT ord, credit FROM credits) c; -$$; ---> statement-breakpoint -CREATE OR REPLACE FUNCTION conditions.flow_osm_credit() -RETURNS jsonb LANGUAGE sql IMMUTABLE PARALLEL SAFE AS $$ - SELECT '[{"sourceId":"openstreetmap","name":"OpenStreetMap","url":"https://www.openstreetmap.org/copyright","licensing":{"version":1,"bindings":[{"scope":"data","subject":"OpenStreetMap","license":{"kind":"spdx","expression":"ODbL-1.0"}}]},"attributionText":"© OpenStreetMap contributors"}]'::jsonb; -$$; diff --git a/packages/core/drizzle/0070_report_refusal.sql b/packages/core/drizzle/0070_report_refusal.sql deleted file mode 100644 index 669d2d688..000000000 --- a/packages/core/drizzle/0070_report_refusal.sql +++ /dev/null @@ -1,9 +0,0 @@ -CREATE TABLE "conditions"."report_refusal" ( - "id" bigserial PRIMARY KEY NOT NULL, - "actor_key_id" text NOT NULL, - "cell" text NOT NULL, - "occurred_at" timestamp with time zone NOT NULL -); ---> statement-breakpoint -CREATE INDEX "idx_report_refusal_actor" ON "conditions"."report_refusal" USING btree ("actor_key_id","occurred_at");--> statement-breakpoint -CREATE INDEX "idx_report_refusal_occurred" ON "conditions"."report_refusal" USING btree ("occurred_at"); \ No newline at end of file diff --git a/packages/core/drizzle/0071_rights_revoked_indexes.sql b/packages/core/drizzle/0071_rights_revoked_indexes.sql deleted file mode 100644 index d1e31fcd4..000000000 --- a/packages/core/drizzle/0071_rights_revoked_indexes.sql +++ /dev/null @@ -1,3 +0,0 @@ -CREATE INDEX "idx_feature_rights_revoked" ON "conditions"."feature" USING btree ("id") WHERE "conditions"."feature"."tombstone_reason" = 'rights_revoked';--> statement-breakpoint -CREATE INDEX "idx_offer_rights_revoked" ON "conditions"."offer" USING btree ("id") WHERE "conditions"."offer"."tombstone_reason" = 'rights_revoked';--> statement-breakpoint -CREATE INDEX "idx_situation_rights_revoked" ON "conditions"."situation" USING btree ("id") WHERE "conditions"."situation"."tombstone_reason" = 'rights_revoked'; \ No newline at end of file diff --git a/packages/core/drizzle/0072_observation_upstream_receipts.sql b/packages/core/drizzle/0072_observation_upstream_receipts.sql deleted file mode 100644 index 91d93918d..000000000 --- a/packages/core/drizzle/0072_observation_upstream_receipts.sql +++ /dev/null @@ -1,32 +0,0 @@ --- Scaffold and snapshot generated by drizzle-kit generate --custom --name=observation_upstream_receipts. --- PostgreSQL function only; no table changes or stored-data conversion. --- Captured provenance is authoritative: never join the mutable source catalogue. -DROP FUNCTION conditions.flow_credit(text, jsonb); ---> statement-breakpoint -CREATE FUNCTION conditions.flow_credit(native_source text, supplied jsonb, upstream jsonb DEFAULT '[]'::jsonb) -RETURNS jsonb LANGUAGE sql IMMUTABLE PARALLEL SAFE AS $$ - WITH identity AS ( - SELECT COALESCE(NULLIF(supplied->>'parentSourceId',''), native_source) AS id, - COALESCE(NULLIF(supplied->>'name',''), supplied->>'provider') AS name - ), credits AS ( - SELECT 0 AS ord, jsonb_strip_nulls(jsonb_build_object( - 'sourceId', identity.id, - 'name', identity.name, - 'url', supplied->>'url', - 'licensing', supplied->'licensing', - 'attributionText', supplied->>'provider', - 'publisher', supplied->'publisher' - )) AS credit FROM identity WHERE identity.name IS NOT NULL - UNION ALL - SELECT 1, jsonb_strip_nulls(jsonb_build_object( - 'sourceId', identity.id, - 'name', identity.name || ' – ' || (u.value->>'publisher'), - 'url', supplied->>'url', - 'licensing', u.value->'licensing', - 'attributionText', u.value->>'attribution', - 'publisher', jsonb_build_object('name', u.value->>'publisher') - )) FROM identity CROSS JOIN LATERAL jsonb_array_elements(COALESCE(upstream, '[]'::jsonb)) u - WHERE NULLIF(u.value->>'publisher','') IS NOT NULL AND identity.name IS NOT NULL - ) SELECT COALESCE(jsonb_agg(credit ORDER BY ord, credit::text), '[]'::jsonb) - FROM (SELECT DISTINCT ord, credit FROM credits) c; -$$; diff --git a/packages/core/drizzle/0073_federation_source_liveness.sql b/packages/core/drizzle/0073_federation_source_liveness.sql deleted file mode 100644 index 173b5e579..000000000 --- a/packages/core/drizzle/0073_federation_source_liveness.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE "conditions"."federation_outbox" DROP CONSTRAINT "federation_outbox_operation_enum";--> statement-breakpoint -ALTER TABLE "conditions"."federation_outbox" ADD CONSTRAINT "federation_outbox_operation_enum" CHECK ("conditions"."federation_outbox"."operation" IN ('create','update','delete','liveness')); \ No newline at end of file diff --git a/packages/core/drizzle/0074_source_shrink.sql b/packages/core/drizzle/0074_source_shrink.sql deleted file mode 100644 index 063501ca6..000000000 --- a/packages/core/drizzle/0074_source_shrink.sql +++ /dev/null @@ -1,10 +0,0 @@ -CREATE TABLE "conditions"."source_shrink" ( - "source_id" text NOT NULL, - "scope" text NOT NULL, - "since" timestamp with time zone NOT NULL, - "polls" integer NOT NULL, - "stated" integer NOT NULL, - "held" integer NOT NULL, - CONSTRAINT "source_shrink_source_id_scope_pk" PRIMARY KEY("source_id","scope"), - CONSTRAINT "source_shrink_scope_enum" CHECK ("conditions"."source_shrink"."scope" IN ('series','records')) -); diff --git a/packages/core/drizzle/0075_federation_peer_cursor.sql b/packages/core/drizzle/0075_federation_peer_cursor.sql deleted file mode 100644 index 7e192b6e6..000000000 --- a/packages/core/drizzle/0075_federation_peer_cursor.sql +++ /dev/null @@ -1,5 +0,0 @@ -CREATE TABLE "conditions"."federation_peer_cursor" ( - "peer_instance_id" text PRIMARY KEY NOT NULL, - "cursor" text DEFAULT '0.0' NOT NULL, - "updated_at" timestamp with time zone NOT NULL -); diff --git a/packages/core/drizzle/0076_federation_peer_lapse.sql b/packages/core/drizzle/0076_federation_peer_lapse.sql deleted file mode 100644 index 86af96886..000000000 --- a/packages/core/drizzle/0076_federation_peer_lapse.sql +++ /dev/null @@ -1,12 +0,0 @@ -CREATE TABLE "conditions"."federation_lapsed_copy" ( - "record_class" text NOT NULL, - "record_id" text NOT NULL, - "peer_instance_id" text NOT NULL, - "source_id" text NOT NULL, - "revision" integer NOT NULL, - "lapsed_at" timestamp with time zone NOT NULL, - CONSTRAINT "federation_lapsed_copy_record_class_record_id_pk" PRIMARY KEY("record_class","record_id") -); ---> statement-breakpoint -ALTER TABLE "conditions"."federation_source_receipt" ADD COLUMN "liveness_at" timestamp with time zone;--> statement-breakpoint -CREATE INDEX "idx_federation_lapsed_copy_source" ON "conditions"."federation_lapsed_copy" USING btree ("peer_instance_id","source_id"); \ No newline at end of file diff --git a/packages/core/drizzle/0077_captured_attribution_receipts.sql b/packages/core/drizzle/0077_captured_attribution_receipts.sql deleted file mode 100644 index 8419e5b24..000000000 --- a/packages/core/drizzle/0077_captured_attribution_receipts.sql +++ /dev/null @@ -1,18 +0,0 @@ -CREATE TABLE "conditions"."public_license_policy" ( - "license" text PRIMARY KEY NOT NULL -); ---> statement-breakpoint -ALTER TABLE "conditions"."contributor_receipt" ADD COLUMN "provenance" jsonb;--> statement-breakpoint -ALTER TABLE "conditions"."observation_rollup_daily" ADD COLUMN "contributor_receipt_ids" text[];--> statement-breakpoint -ALTER TABLE "conditions"."observation_rollup_daily" ADD COLUMN "lineage_complete" boolean DEFAULT false NOT NULL;--> statement-breakpoint -ALTER TABLE "conditions"."observation_rollup_hourly" ADD COLUMN "contributor_receipt_ids" text[];--> statement-breakpoint -ALTER TABLE "conditions"."observation_rollup_hourly" ADD COLUMN "lineage_complete" boolean DEFAULT false NOT NULL;--> statement-breakpoint -ALTER TABLE "conditions"."segment_observation" ADD COLUMN "permission_licenses" text[];--> statement-breakpoint -ALTER TABLE "conditions"."segment_profile" ADD COLUMN "contributor_receipt_ids" text[];--> statement-breakpoint -ALTER TABLE "conditions"."segment_profile" ADD COLUMN "lineage_complete" boolean DEFAULT false NOT NULL;--> statement-breakpoint -ALTER TABLE "conditions"."segment_profile" ADD COLUMN "permission_licenses" text[];--> statement-breakpoint -ALTER TABLE "conditions"."segment_speed" ADD COLUMN "permission_licenses" text[];--> statement-breakpoint -ALTER TABLE "conditions"."sensor_baseline" ADD COLUMN "contributor_receipt_ids" text[];--> statement-breakpoint -ALTER TABLE "conditions"."sensor_baseline" ADD COLUMN "lineage_complete" boolean DEFAULT false NOT NULL;--> statement-breakpoint -ALTER TABLE "conditions"."sensor_baseline" ADD COLUMN "permission_licenses" text[];--> statement-breakpoint -ALTER TABLE "conditions"."sensor_baseline" ADD COLUMN "contributing" text[]; \ No newline at end of file diff --git a/packages/core/drizzle/0078_captured_attribution_functions.sql b/packages/core/drizzle/0078_captured_attribution_functions.sql deleted file mode 100644 index 0c3f5d0d5..000000000 --- a/packages/core/drizzle/0078_captured_attribution_functions.sql +++ /dev/null @@ -1,117 +0,0 @@ --- Current affirmative policy is synchronized from the reviewed JS registry at boot. --- Missing measurement evidence and unrecognized IDs fail closed; credits never authorize use. -CREATE FUNCTION conditions.flow_public_licenses(licenses text[]) -RETURNS boolean LANGUAGE sql STABLE PARALLEL SAFE AS $$ - SELECT licenses IS NOT NULL AND cardinality(licenses) > 0 - AND NOT EXISTS (SELECT 1 FROM unnest(licenses) l(license) - WHERE l.license IS NULL OR NOT EXISTS ( - SELECT 1 FROM conditions.public_license_policy p WHERE p.license = l.license)); -$$; ---> statement-breakpoint --- Null/empty member evidence poisons the union instead of silently disappearing. -CREATE FUNCTION conditions.flow_permission_union(inputs jsonb) -RETURNS text[] LANGUAGE sql IMMUTABLE PARALLEL SAFE AS $$ - SELECT CASE WHEN inputs IS NOT NULL AND jsonb_array_length(inputs) > 0 - AND NOT EXISTS (SELECT 1 FROM jsonb_array_elements(inputs) i - WHERE jsonb_typeof(i) <> 'array' OR i = '[]'::jsonb) - THEN ARRAY(SELECT DISTINCT l.license FROM jsonb_array_elements(inputs) i - CROSS JOIN LATERAL jsonb_array_elements_text(i) l(license) ORDER BY l.license) END; -$$; ---> statement-breakpoint -CREATE OR REPLACE FUNCTION conditions.segment_flow(z integer, x integer, y integer, query_params json) -RETURNS bytea AS $$ -DECLARE bounds geometry := ST_TileEnvelope(z, x, y); mvt bytea; -BEGIN - SELECT ST_AsMVT(t, 'segment_flow', 4096, 'geom') INTO mvt FROM ( - SELECT s.segment_id, s.dir, s.highway, - sp.speed_ratio, sp.los, sp.confidence, sp.current_kph, sp.free_flow_kph, - 1 AS lineage_version, - COALESCE(sp.field_sources, jsonb_build_object('geometry', jsonb_build_array('openstreetmap')))::text AS field_sources, - COALESCE(sp.field_contributors, jsonb_build_object('geometry', conditions.flow_osm_credit()))::text AS field_contributors, - COALESCE(sp.field_lineage_complete, jsonb_build_object('geometry',true,'speed',sp.current_kph IS NULL,'freeFlow',sp.free_flow_kph IS NULL,'ratio',sp.speed_ratio IS NULL,'los',sp.los IS NULL,'confidence',sp.confidence IS NULL))::text AS field_lineage_complete, - ST_AsMVTGeom(ST_Transform(s.geom, 3857), bounds, 4096, 64, true) AS geom - FROM conditions.road_segment s - LEFT JOIN conditions.segment_speed sp ON sp.segment_id = s.segment_id - AND conditions.flow_public_licenses(sp.permission_licenses) - AND NOT EXISTS (SELECT 1 FROM conditions.source scope_source - WHERE scope_source.id = ANY(sp.contributing) AND scope_source.restricted) - WHERE s.min_zoom <= z AND s.geom && ST_Transform(bounds, 4326) - ) t WHERE t.geom IS NOT NULL; - RETURN COALESCE(mvt, ''::bytea); -END; -$$ LANGUAGE plpgsql STABLE STRICT PARALLEL SAFE; - ---> statement-breakpoint --- Function-only extension of immutable captured receipts; no stored-data conversion. --- One projection serves native and explicitly captured upstream sources alike. -CREATE FUNCTION conditions.flow_credit_licensing(supplied jsonb) -RETURNS jsonb LANGUAGE plpgsql IMMUTABLE PARALLEL SAFE AS $$ -DECLARE - captured jsonb := supplied->'licensing'; - captured_url text := NULLIF(supplied->>'licenseUrl',''); - declarations jsonb; - matched integer; -BEGIN - IF captured_url IS NULL OR EXISTS ( - SELECT 1 FROM jsonb_array_elements(COALESCE(captured->'declarations','[]'::jsonb)) d WHERE d->>'url'=captured_url - UNION ALL - SELECT 1 FROM jsonb_array_elements(COALESCE(captured->'bindings','[]'::jsonb)) b WHERE b #>> '{license,url}'=captured_url - ) THEN RETURN captured; END IF; - captured := COALESCE(captured,'{"version":1,"bindings":[]}'::jsonb); - declarations := COALESCE(captured->'declarations','[]'::jsonb); - SELECT ordinality::integer-1 INTO matched FROM jsonb_array_elements(declarations) WITH ORDINALITY d(value,ordinality) - WHERE d.value->>'text'=supplied->>'license' AND NOT d.value ? 'url' ORDER BY ordinality LIMIT 1; - IF matched IS NOT NULL THEN - declarations := jsonb_set(declarations,ARRAY[matched::text],(declarations->matched)||jsonb_build_object('url',captured_url)); - ELSE - IF jsonb_array_length(declarations)>=64 OR length(supplied->>'license')>1000 THEN - RAISE EXCEPTION 'captured licence URL exceeds portable declaration capacity'; - END IF; - declarations := declarations || jsonb_build_array(jsonb_strip_nulls(jsonb_build_object('text',supplied->>'license','url',captured_url))); - END IF; - RETURN jsonb_set(captured,'{declarations}',declarations); -END; -$$; ---> statement-breakpoint -CREATE FUNCTION conditions.flow_source_credit(native_source text, supplied jsonb) -RETURNS jsonb LANGUAGE sql IMMUTABLE PARALLEL SAFE AS $$ - SELECT COALESCE(jsonb_agg(jsonb_strip_nulls(jsonb_build_object( - 'sourceId', COALESCE(NULLIF(supplied->>'parentSourceId',''),native_source), - 'name', COALESCE(NULLIF(supplied->>'name',''),supplied->>'provider'), - 'url',supplied->>'url','licensing',conditions.flow_credit_licensing(supplied), - 'attributionText',supplied->>'provider','publisher',supplied->'publisher' - ))),'[]'::jsonb) - WHERE COALESCE(NULLIF(supplied->>'name',''),supplied->>'provider') IS NOT NULL; -$$; ---> statement-breakpoint -CREATE OR REPLACE FUNCTION conditions.flow_credit(native_source text, supplied jsonb, upstream jsonb DEFAULT '[]'::jsonb) -RETURNS jsonb LANGUAGE sql IMMUTABLE PARALLEL SAFE AS $$ - WITH credits AS ( - SELECT 0 AS ord,c.value AS credit FROM jsonb_array_elements(conditions.flow_source_credit(native_source,supplied)) c - UNION ALL - SELECT 1,c.value FROM jsonb_array_elements(COALESCE(upstream,'[]'::jsonb)) u - CROSS JOIN LATERAL jsonb_array_elements(CASE WHEN u.value ? 'source' - THEN conditions.flow_source_credit(u.value #>> '{source,sourceId}',u.value #> '{source,attribution}') - ELSE CASE WHEN NULLIF(u.value->>'publisher','') IS NOT NULL - THEN jsonb_build_array(jsonb_strip_nulls(jsonb_build_object( - 'sourceId',COALESCE(NULLIF(supplied->>'parentSourceId',''),native_source), - 'name',COALESCE(NULLIF(supplied->>'name',''),supplied->>'provider') || ' – ' || (u.value->>'publisher'), - 'licensing',u.value->'licensing','attributionText',u.value->>'attribution', - 'publisher',jsonb_build_object('name',u.value->>'publisher') - ))) ELSE '[]'::jsonb END END) c - ) SELECT COALESCE(jsonb_agg(credit ORDER BY ord,credit::text),'[]'::jsonb) - FROM (SELECT credit,min(ord) AS ord FROM credits GROUP BY credit) unique_credits; -$$; ---> statement-breakpoint --- Both declared selectors remain policy facts even for unsealed custom inputs. -CREATE OR REPLACE FUNCTION conditions.flow_receipt_permissions(receipt_ids text[], complete boolean, receipt_version integer) -RETURNS text[] LANGUAGE sql STABLE PARALLEL SAFE AS $$ - SELECT CASE WHEN complete IS TRUE THEN conditions.flow_permission_union(jsonb_agg( - CASE WHEN r.provenance #>> '{attribution,license}' IS NOT NULL THEN to_jsonb( - ARRAY[r.provenance #>> '{attribution,license}'] || ARRAY( - SELECT l.license FROM jsonb_array_elements(COALESCE(r.provenance->'upstream','[]'::jsonb)) u - CROSS JOIN LATERAL(VALUES (CASE WHEN u ? 'license' THEN COALESCE(u->>'license','') END),(CASE WHEN u ? 'source' THEN COALESCE(u #>> '{source,attribution,license}','') END)) l(license) - WHERE l.license IS NOT NULL)) END)) END - FROM unnest(receipt_ids) ids(receipt_id) - LEFT JOIN conditions.contributor_receipt r ON r.id=ids.receipt_id AND r.version=receipt_version; -$$; diff --git a/packages/core/drizzle/0079_oauth_grant.sql b/packages/core/drizzle/0079_oauth_grant.sql deleted file mode 100644 index 1531b761a..000000000 --- a/packages/core/drizzle/0079_oauth_grant.sql +++ /dev/null @@ -1,11 +0,0 @@ -CREATE TABLE "conditions"."oauth_grant" ( - "grant_key" text PRIMARY KEY NOT NULL, - "refresh_token" text NOT NULL, - "refresh_issued_at" timestamp with time zone NOT NULL, - "access_token" text, - "access_expires_at" timestamp with time zone, - "rejected_at" timestamp with time zone, - "last_error" text, - "last_error_at" timestamp with time zone, - "updated_at" timestamp with time zone DEFAULT now() NOT NULL -); diff --git a/packages/core/drizzle/0080_situation_severity_none.sql b/packages/core/drizzle/0080_situation_severity_none.sql deleted file mode 100644 index b8a053316..000000000 --- a/packages/core/drizzle/0080_situation_severity_none.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE "conditions"."situation" DROP CONSTRAINT "situation_severity_enum";--> statement-breakpoint -ALTER TABLE "conditions"."situation" ADD CONSTRAINT "situation_severity_enum" CHECK ("severity" IN ('none', 'minor', 'moderate', 'major', 'critical', 'unknown')); \ No newline at end of file diff --git a/packages/core/drizzle/0081_federation_key_endorsement.sql b/packages/core/drizzle/0081_federation_key_endorsement.sql deleted file mode 100644 index 2d602c19c..000000000 --- a/packages/core/drizzle/0081_federation_key_endorsement.sql +++ /dev/null @@ -1,9 +0,0 @@ -CREATE TABLE "conditions"."federation_peer_key" ( - "peer_instance_id" text NOT NULL, - "key_id" text NOT NULL, - "learned_at" timestamp with time zone NOT NULL, - CONSTRAINT "federation_peer_key_peer_instance_id_key_id_pk" PRIMARY KEY("peer_instance_id","key_id") -); ---> statement-breakpoint -ALTER TABLE "conditions"."federation_instance_key" ADD COLUMN "endorsed_by" text;--> statement-breakpoint -ALTER TABLE "conditions"."federation_instance_key" ADD COLUMN "endorsement" "bytea"; \ No newline at end of file diff --git a/packages/core/drizzle/0082_federation_single_subscription.sql b/packages/core/drizzle/0082_federation_single_subscription.sql deleted file mode 100644 index 7eba54862..000000000 --- a/packages/core/drizzle/0082_federation_single_subscription.sql +++ /dev/null @@ -1 +0,0 @@ -CREATE UNIQUE INDEX "uq_federation_subscription_target" ON "conditions"."federation_subscription" USING btree ("peer_id","delivery_mode",coalesce("inbox_url", '')) WHERE "conditions"."federation_subscription"."delivery_mode" <> 'sse'; \ No newline at end of file diff --git a/packages/core/drizzle/0083_federation_key_anchor.sql b/packages/core/drizzle/0083_federation_key_anchor.sql deleted file mode 100644 index 60af22ade..000000000 --- a/packages/core/drizzle/0083_federation_key_anchor.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE "conditions"."federation_instance_key" ADD COLUMN "endorsement_proof" "bytea";--> statement-breakpoint -ALTER TABLE "conditions"."federation_peer_key" ADD COLUMN "anchor" text NOT NULL; \ No newline at end of file diff --git a/packages/core/drizzle/0084_federation_delete_revision.sql b/packages/core/drizzle/0084_federation_delete_revision.sql deleted file mode 100644 index 076c2e87b..000000000 --- a/packages/core/drizzle/0084_federation_delete_revision.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE "conditions"."federation_outbox" ADD COLUMN "revision" integer; \ No newline at end of file diff --git a/packages/core/drizzle/0085_federation_journal_delete_revision.sql b/packages/core/drizzle/0085_federation_journal_delete_revision.sql deleted file mode 100644 index 803961e04..000000000 --- a/packages/core/drizzle/0085_federation_journal_delete_revision.sql +++ /dev/null @@ -1,48 +0,0 @@ --- A journalled delete carries the revision the record ended at, so a --- subscriber orders it against the record's changes: it ends a copy no newer --- than that, and a change it received earlier by another channel stays. --- drizzle-kit cannot model functions, so the DDL is authored here. -CREATE OR REPLACE FUNCTION "conditions".federation_journal_tombstone(cls text, rec record) RETURNS void AS $$ -BEGIN - IF NOT "conditions".federation_wants(cls) AND NOT EXISTS ( - SELECT 1 FROM "conditions"."federation_outbox" - WHERE record_class = cls AND record_id = rec.id) THEN - RETURN; - END IF; - INSERT INTO "conditions"."federation_outbox" - (operation, record_class, record_id, canonical_id, kind, domain, tombstone_reason, revision) - VALUES ('delete', cls, rec.id, rec.canonical_id, rec.kind, rec.domain, rec.tombstone_reason, - rec.revision); - IF rec.tombstone_reason = 'rights_revoked' THEN - DELETE FROM "conditions"."federation_outbox" - WHERE record_class = cls AND record_id = rec.id AND operation <> 'delete'; - END IF; -END; -$$ LANGUAGE plpgsql; ---> statement-breakpoint --- The deletes already journalled: a record still ended ended at its current --- revision; one live again ended at the last revision recorded by the time --- of its delete. -UPDATE "conditions"."federation_outbox" o - SET revision = CASE WHEN r.tombstoned_at IS NOT NULL THEN r.revision ELSE COALESCE( - (SELECT max(h.revision) FROM "conditions"."situation_revision" h - WHERE h.situation_id = r.id AND h.recorded_at <= o.created_at), r.revision) END - FROM "conditions"."situation" r - WHERE o.operation = 'delete' AND o.revision IS NULL - AND o.record_class = 'situation' AND r.id = o.record_id; ---> statement-breakpoint -UPDATE "conditions"."federation_outbox" o - SET revision = CASE WHEN r.tombstoned_at IS NOT NULL THEN r.revision ELSE COALESCE( - (SELECT max(h.revision) FROM "conditions"."feature_revision" h - WHERE h.feature_id = r.id AND h.recorded_at <= o.created_at), r.revision) END - FROM "conditions"."feature" r - WHERE o.operation = 'delete' AND o.revision IS NULL - AND o.record_class = 'feature' AND r.id = o.record_id; ---> statement-breakpoint -UPDATE "conditions"."federation_outbox" o - SET revision = CASE WHEN r.tombstoned_at IS NOT NULL THEN r.revision ELSE COALESCE( - (SELECT max(h.revision) FROM "conditions"."offer_revision" h - WHERE h.offer_id = r.id AND h.recorded_at <= o.created_at), r.revision) END - FROM "conditions"."offer" r - WHERE o.operation = 'delete' AND o.revision IS NULL - AND o.record_class = 'offer' AND r.id = o.record_id; diff --git a/packages/core/drizzle/0086_archive_file.sql b/packages/core/drizzle/0086_archive_file.sql deleted file mode 100644 index 25c40b6bf..000000000 --- a/packages/core/drizzle/0086_archive_file.sql +++ /dev/null @@ -1,7 +0,0 @@ -CREATE TABLE "conditions"."archive_file" ( - "record_class" text PRIMARY KEY NOT NULL, - "file_name" text NOT NULL, - "sha256" text NOT NULL, - "bytes" bigint NOT NULL, - "built_at" timestamp with time zone NOT NULL -); diff --git a/packages/core/drizzle/0087_federation_peer_cadence.sql b/packages/core/drizzle/0087_federation_peer_cadence.sql deleted file mode 100644 index 1dbccd444..000000000 --- a/packages/core/drizzle/0087_federation_peer_cadence.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE "conditions"."federation_source_receipt" ADD COLUMN "cadence_sec" integer; \ No newline at end of file diff --git a/packages/core/drizzle/0088_federation_archive_landed.sql b/packages/core/drizzle/0088_federation_archive_landed.sql deleted file mode 100644 index baa25d6c0..000000000 --- a/packages/core/drizzle/0088_federation_archive_landed.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE "conditions"."federation_peer_cursor" ADD COLUMN "archive_built_at" timestamp with time zone;--> statement-breakpoint -ALTER TABLE "conditions"."federation_peer_cursor" ADD COLUMN "archive_landed_at" timestamp with time zone; \ No newline at end of file diff --git a/packages/core/drizzle/0089_latest_autovacuum.sql b/packages/core/drizzle/0089_latest_autovacuum.sql deleted file mode 100644 index 7f059bc8c..000000000 --- a/packages/core/drizzle/0089_latest_autovacuum.sql +++ /dev/null @@ -1,12 +0,0 @@ --- A latest row is updated in place by every poll of its source, and nearly --- every update is heap-only: the next update or read of its page prunes --- the old version, with no vacuum needed. The default thresholds count those --- updates as if vacuum had to clean them up, so a flow source rewriting a --- hundred thousand readings a minute had the table vacuumed every few --- minutes and analysed every minute, each pass dirtying pages the updates --- had just written. Vacuum is left for the index entries of the updates --- that are not heap-only (category readings, expiries), when the dead rows --- reach half the table, and analysis for when the table has changed twice --- over: an update changes a reading, not the distribution of series the --- planner reads. -ALTER TABLE "conditions"."observation_latest" SET (autovacuum_vacuum_scale_factor = 0.5, autovacuum_analyze_scale_factor = 2); diff --git a/packages/core/drizzle/0090_derived_baseline_overall_only.sql b/packages/core/drizzle/0090_derived_baseline_overall_only.sql deleted file mode 100644 index 31cd13ce8..000000000 --- a/packages/core/drizzle/0090_derived_baseline_overall_only.sql +++ /dev/null @@ -1,6 +0,0 @@ --- A derived baseline is a site's overall free flow, the (-1, -1) row: that --- row alone is read, and typical speeds per weekday and hour are the segment --- profiles'. The derivation wrote 48 more rows a site each night, which --- nothing read, and no longer does; those it wrote go. -DELETE FROM "conditions"."sensor_baseline" - WHERE "method" = 'derived' AND ("dow_bucket" <> -1 OR "tod_bucket" <> -1); diff --git a/packages/core/drizzle/0091_compact_latest_identity.sql b/packages/core/drizzle/0091_compact_latest_identity.sql deleted file mode 100644 index 2e31fd196..000000000 --- a/packages/core/drizzle/0091_compact_latest_identity.sql +++ /dev/null @@ -1,17 +0,0 @@ --- Expand both the original reading format and the compact local-id format. --- This changes no stored rows: writers convert them as readings arrive. --- Keep this decoder when rolling application code back; older writers and --- readers using observation_record remain compatible with both formats. -CREATE OR REPLACE FUNCTION "conditions".observation_record(template jsonb, reading jsonb) -RETURNS jsonb LANGUAGE sql IMMUTABLE AS $$ - SELECT (template - 'namespace' - 'provenance') || (reading - 'provenance') - || jsonb_build_object('provenance', - (template -> 'provenance') || COALESCE(reading -> 'provenance', '{}'::jsonb)) - || CASE WHEN reading ->> 'id' ~ '^[0-9a-f]{64}$' THEN - jsonb_build_object( - 'id', 'oc:observation:' || (template ->> 'namespace') || ':' || (reading ->> 'id'), - 'canonicalId', encode(sha256(convert_to( - '[' || to_json(template ->> 'namespace')::text || ',' - || to_json(reading ->> 'id')::text || ']', 'UTF8')), 'hex')) - ELSE '{}'::jsonb END -$$; diff --git a/packages/core/drizzle/0092_compact_fused_lineage.sql b/packages/core/drizzle/0092_compact_fused_lineage.sql deleted file mode 100644 index a63cf8af5..000000000 --- a/packages/core/drizzle/0092_compact_fused_lineage.sql +++ /dev/null @@ -1,54 +0,0 @@ --- New writers keep changing fused contributor IDs once in the reading. --- No rows are rewritten. Retain this decoder when rolling application code --- back: older writers still emit a format this function accepts. -CREATE OR REPLACE FUNCTION "conditions".observation_fusion_provenance( - provenance jsonb, ids jsonb, local_id text -) RETURNS jsonb LANGUAGE plpgsql IMMUTABLE AS $$ -DECLARE - merged jsonb; - refs jsonb; -BEGIN - IF provenance ->> 'origin' IS DISTINCT FROM 'derived' - OR COALESCE(provenance ->> 'sourceId', '') NOT IN ('@fused', '@fused-public') - OR jsonb_typeof(provenance -> 'derivedFrom') IS DISTINCT FROM 'object' - OR provenance #>> '{derivedFrom,method}' IS DISTINCT FROM 'fusion' - OR jsonb_typeof(provenance -> 'mergedSources') IS DISTINCT FROM 'array' - OR jsonb_typeof(ids) IS DISTINCT FROM 'array' - OR local_id IS NULL OR local_id !~ '^[0-9a-f]{64}$' THEN - RAISE EXCEPTION 'Invalid compact fused lineage' USING ERRCODE = '22023'; - END IF; - IF jsonb_array_length(ids) = 0 - OR jsonb_array_length(ids) <> jsonb_array_length(provenance -> 'mergedSources') - OR EXISTS (SELECT 1 FROM jsonb_array_elements(ids) WHERE jsonb_typeof(value) <> 'string') - OR EXISTS (SELECT 1 FROM jsonb_array_elements(provenance -> 'mergedSources') - WHERE jsonb_typeof(value) <> 'object') THEN - RAISE EXCEPTION 'Invalid compact fused lineage' USING ERRCODE = '22023'; - END IF; - SELECT jsonb_agg(value || jsonb_build_object('recordId', ids -> (ordinality - 1)::integer) - ORDER BY ordinality) - INTO merged FROM jsonb_array_elements(provenance -> 'mergedSources') WITH ORDINALITY; - SELECT jsonb_agg(jsonb_build_object('class', 'observation', 'id', value) ORDER BY ordinality) - INTO refs FROM jsonb_array_elements(ids) WITH ORDINALITY; - RETURN provenance || jsonb_build_object( - 'recordId', local_id, 'mergedSources', merged, - 'derivedFrom', (provenance -> 'derivedFrom') || jsonb_build_object('records', refs)); -END -$$; ---> statement-breakpoint -CREATE OR REPLACE FUNCTION "conditions".observation_record(template jsonb, reading jsonb) -RETURNS jsonb LANGUAGE sql IMMUTABLE AS $$ - SELECT (template - 'namespace' - 'provenance') || (reading - 'provenance' - '_ocFusionRecordIds') - || jsonb_build_object('provenance', - CASE WHEN reading ? '_ocFusionRecordIds' THEN - conditions.observation_fusion_provenance( - (template -> 'provenance') || COALESCE(reading -> 'provenance', '{}'::jsonb), - reading -> '_ocFusionRecordIds', reading ->> 'id') - ELSE (template -> 'provenance') || COALESCE(reading -> 'provenance', '{}'::jsonb) END) - || CASE WHEN reading ->> 'id' ~ '^[0-9a-f]{64}$' THEN - jsonb_build_object( - 'id', 'oc:observation:' || (template ->> 'namespace') || ':' || (reading ->> 'id'), - 'canonicalId', encode(sha256(convert_to( - '[' || to_json(template ->> 'namespace')::text || ',' - || to_json(reading ->> 'id')::text || ']', 'UTF8')), 'hex')) - ELSE '{}'::jsonb END -$$; diff --git a/packages/core/drizzle/0093_source_publication_clock.sql b/packages/core/drizzle/0093_source_publication_clock.sql deleted file mode 100644 index 910000f0b..000000000 --- a/packages/core/drizzle/0093_source_publication_clock.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE "conditions"."source_status" ADD COLUMN "source_published_at" timestamp with time zone; diff --git a/packages/core/drizzle/0094_smn_cap_message.sql b/packages/core/drizzle/0094_smn_cap_message.sql deleted file mode 100644 index 5f1c8725c..000000000 --- a/packages/core/drizzle/0094_smn_cap_message.sql +++ /dev/null @@ -1,7 +0,0 @@ -CREATE TABLE "conditions"."smn_cap_message" ( - "source_id" text NOT NULL, - "identifier" text NOT NULL, - "body" "bytea" NOT NULL, - "retain_until" timestamp with time zone NOT NULL, - CONSTRAINT "smn_cap_message_source_id_identifier_pk" PRIMARY KEY("source_id","identifier") -); diff --git a/packages/core/drizzle/0095_glorious_adam_destine.sql b/packages/core/drizzle/0095_glorious_adam_destine.sql deleted file mode 100644 index 84b02a50b..000000000 --- a/packages/core/drizzle/0095_glorious_adam_destine.sql +++ /dev/null @@ -1,10 +0,0 @@ -CREATE TABLE "conditions"."smn_cap_decision" ( - "source_id" text PRIMARY KEY NOT NULL, - "decided_at" timestamp with time zone NOT NULL, - "decision" jsonb NOT NULL -); ---> statement-breakpoint -ALTER TABLE "conditions"."smn_cap_message" DROP CONSTRAINT "smn_cap_message_source_id_identifier_pk";--> statement-breakpoint -ALTER TABLE "conditions"."smn_cap_message" ADD COLUMN "variant" text GENERATED ALWAYS AS (encode(sha256(body), 'hex')) STORED NOT NULL;--> statement-breakpoint -ALTER TABLE "conditions"."smn_cap_message" ADD COLUMN "retrieval" jsonb DEFAULT '{"legacy":true}'::jsonb NOT NULL;--> statement-breakpoint -ALTER TABLE "conditions"."smn_cap_message" ADD CONSTRAINT "smn_cap_message_source_id_variant_pk" PRIMARY KEY("source_id","variant"); diff --git a/packages/core/drizzle/0096_small_tigra.sql b/packages/core/drizzle/0096_small_tigra.sql deleted file mode 100644 index 86f576ad5..000000000 --- a/packages/core/drizzle/0096_small_tigra.sql +++ /dev/null @@ -1,9 +0,0 @@ -CREATE TABLE "conditions"."nsw_rfs_clock" ( - "source_id" text NOT NULL, - "incident_id" text NOT NULL, - "sent" text NOT NULL, - "published" text NOT NULL, - "content" text NOT NULL, - "expiry" text NOT NULL, - CONSTRAINT "nsw_rfs_clock_source_id_incident_id_pk" PRIMARY KEY("source_id","incident_id") -); diff --git a/packages/core/drizzle/0097_geonet_coverage.sql b/packages/core/drizzle/0097_geonet_coverage.sql deleted file mode 100644 index 1786446ad..000000000 --- a/packages/core/drizzle/0097_geonet_coverage.sql +++ /dev/null @@ -1,7 +0,0 @@ -CREATE TABLE conditions.geonet_coverage ( - source_id text PRIMARY KEY, - revisions jsonb NOT NULL DEFAULT '{}'::jsonb, - covered_from timestamptz NOT NULL, - covered_until timestamptz NOT NULL, - CONSTRAINT geonet_coverage_order CHECK (covered_from < covered_until) -); diff --git a/packages/core/drizzle/0098_observation_revision.sql b/packages/core/drizzle/0098_observation_revision.sql deleted file mode 100644 index 74d7ba246..000000000 --- a/packages/core/drizzle/0098_observation_revision.sql +++ /dev/null @@ -1,10 +0,0 @@ -CREATE TABLE "conditions"."observation_revision" ( - "source_id" text NOT NULL, - "feature_id" text NOT NULL, - "property" text NOT NULL, - "measured_at" timestamp with time zone NOT NULL, - "rank" text NOT NULL, - "signature" text NOT NULL, - "suppressed" boolean NOT NULL, - CONSTRAINT "observation_revision_source_id_feature_id_property_pk" PRIMARY KEY("source_id","feature_id","property") -); diff --git a/packages/core/drizzle/0099_tiresome_frightful_four.sql b/packages/core/drizzle/0099_tiresome_frightful_four.sql deleted file mode 100644 index 9247f9de6..000000000 --- a/packages/core/drizzle/0099_tiresome_frightful_four.sql +++ /dev/null @@ -1,13 +0,0 @@ -CREATE TABLE "conditions"."jma_budget" ( - "egress" text NOT NULL, - "day" text NOT NULL, - "used" bigint DEFAULT 0 NOT NULL, - "reserved" bigint DEFAULT 0 NOT NULL, - CONSTRAINT "jma_budget_egress_day_pk" PRIMARY KEY("egress","day"), - CONSTRAINT "jma_budget_nonnegative" CHECK ("conditions"."jma_budget"."used" >= 0 AND "conditions"."jma_budget"."reserved" >= 0) -); ---> statement-breakpoint -CREATE TABLE "conditions"."jma_download" ( - "url" text PRIMARY KEY NOT NULL, - "value" jsonb NOT NULL -); diff --git a/packages/core/drizzle/0100_calm_kabuki.sql b/packages/core/drizzle/0100_calm_kabuki.sql deleted file mode 100644 index e226f490a..000000000 --- a/packages/core/drizzle/0100_calm_kabuki.sql +++ /dev/null @@ -1,4 +0,0 @@ -CREATE TABLE "conditions"."jma_state" ( - "source" text PRIMARY KEY NOT NULL, - "value" jsonb NOT NULL -); diff --git a/packages/core/drizzle/0101_federation_journal_epoch.sql b/packages/core/drizzle/0101_federation_journal_epoch.sql deleted file mode 100644 index 7ddca7d88..000000000 --- a/packages/core/drizzle/0101_federation_journal_epoch.sql +++ /dev/null @@ -1,15 +0,0 @@ -CREATE TABLE "conditions"."federation_journal" ( - "singleton" boolean PRIMARY KEY DEFAULT true NOT NULL, - "epoch" uuid NOT NULL, - "started_at" timestamp with time zone NOT NULL, - "seen_xid" "xid8" NOT NULL, - "timeline_id" integer, - CONSTRAINT "federation_journal_single_row" CHECK ("conditions"."federation_journal"."singleton") -); ---> statement-breakpoint -ALTER TABLE "conditions"."federation_peer_cursor" ADD COLUMN "journal_epoch" text;--> statement-breakpoint -ALTER TABLE "conditions"."federation_peer_cursor" ADD COLUMN "cursor_reset_at" timestamp with time zone;--> statement-breakpoint --- The journal that exists is adopted as the first epoch: nothing is emptied. --- The timeline is filled in by the federation service once it can read it. -INSERT INTO "conditions"."federation_journal" (epoch, started_at, seen_xid, timeline_id) -VALUES (gen_random_uuid(), now(), pg_snapshot_xmax(pg_current_snapshot()), NULL); diff --git a/packages/core/drizzle/0102_federation_subscription_lease.sql b/packages/core/drizzle/0102_federation_subscription_lease.sql deleted file mode 100644 index 7bf48874b..000000000 --- a/packages/core/drizzle/0102_federation_subscription_lease.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE "conditions"."federation_subscription" ADD COLUMN "expires_at" timestamp with time zone DEFAULT now() + interval '30 days' NOT NULL; \ No newline at end of file diff --git a/packages/core/drizzle/0103_federation_reconcile.sql b/packages/core/drizzle/0103_federation_reconcile.sql deleted file mode 100644 index da6ccc9c8..000000000 --- a/packages/core/drizzle/0103_federation_reconcile.sql +++ /dev/null @@ -1,8 +0,0 @@ -ALTER TABLE "conditions"."federation_peer_capabilities" ADD COLUMN "protocol_version" text;--> statement-breakpoint -ALTER TABLE "conditions"."federation_peer_cursor" ADD COLUMN "reconcile_due_since" timestamp with time zone;--> statement-breakpoint -ALTER TABLE "conditions"."federation_peer_cursor" ADD COLUMN "reconcile_class" text;--> statement-breakpoint -ALTER TABLE "conditions"."federation_peer_cursor" ADD COLUMN "reconcile_after" text;--> statement-breakpoint -ALTER TABLE "conditions"."federation_peer_cursor" ADD COLUMN "reconciled_at" timestamp with time zone;--> statement-breakpoint -CREATE INDEX "idx_feature_id_bytes" ON "conditions"."feature" USING btree ("id" COLLATE "C");--> statement-breakpoint -CREATE INDEX "idx_offer_id_bytes" ON "conditions"."offer" USING btree ("id" COLLATE "C");--> statement-breakpoint -CREATE INDEX "idx_situation_id_bytes" ON "conditions"."situation" USING btree ("id" COLLATE "C"); \ No newline at end of file diff --git a/packages/core/drizzle/0104_federation_journal_identity.sql b/packages/core/drizzle/0104_federation_journal_identity.sql deleted file mode 100644 index 767ae39f1..000000000 --- a/packages/core/drizzle/0104_federation_journal_identity.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE "conditions"."federation_journal" ADD COLUMN "database_oid" bigint;--> statement-breakpoint -ALTER TABLE "conditions"."federation_journal" ADD COLUMN "system_identifier" bigint; \ No newline at end of file diff --git a/packages/core/drizzle/0105_osm_oneway_direction.sql b/packages/core/drizzle/0105_osm_oneway_direction.sql deleted file mode 100644 index 3fbe09605..000000000 --- a/packages/core/drizzle/0105_osm_oneway_direction.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE "conditions"."osm_road" ADD COLUMN "oneway_reversed" boolean DEFAULT false NOT NULL; \ No newline at end of file diff --git a/packages/core/drizzle/0106_invalidate_legacy_road_graph.sql b/packages/core/drizzle/0106_invalidate_legacy_road_graph.sql deleted file mode 100644 index e5e01d2db..000000000 --- a/packages/core/drizzle/0106_invalidate_legacy_road_graph.sql +++ /dev/null @@ -1,6 +0,0 @@ --- The reverse direction of legacy one-way roads was never persisted. A default --- cannot reconstruct it; withhold graph-derived route effects until a complete --- import and rebuild records the new direction-aware import provenance. -UPDATE "conditions"."road_graph_state" SET "status" = 'rebuilding' WHERE "singleton"; ---> statement-breakpoint -UPDATE "conditions"."record_binding" SET "status" = 'obsolete'; diff --git a/packages/core/drizzle/meta/0000_snapshot.json b/packages/core/drizzle/meta/0000_snapshot.json index 798d59ace..e16a3d5e2 100644 --- a/packages/core/drizzle/meta/0000_snapshot.json +++ b/packages/core/drizzle/meta/0000_snapshot.json @@ -1,236 +1,302 @@ { - "id": "cbf6629c-cd9e-4fb8-a076-e079b85fa96a", + "id": "07985733-6696-46d3-9be2-7d3a6a1af430", "prevId": "00000000-0000-0000-0000-000000000000", "version": "7", "dialect": "postgresql", "tables": { - "conditions.observations": { - "name": "observations", + "conditions.binding_queue": { + "name": "binding_queue", "schema": "conditions", "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", + "record_class": { + "name": "record_class", "type": "text", "primaryKey": false, "notNull": true }, - "source_format": { - "name": "source_format", + "record_id": { + "name": "record_id", "type": "text", "primaryKey": false, "notNull": true }, - "domain": { - "name": "domain", + "effect_id": { + "name": "effect_id", "type": "text", "primaryKey": false, - "notNull": true + "notNull": true, + "default": "''" }, - "kind": { - "name": "kind", - "type": "text", + "record_revision": { + "name": "record_revision", + "type": "integer", "primaryKey": false, "notNull": true }, - "type": { - "name": "type", - "type": "text", + "attempts": { + "name": "attempts", + "type": "integer", "primaryKey": false, - "notNull": false + "notNull": true, + "default": 0 }, - "subtype": { - "name": "subtype", - "type": "text", + "next_attempt_at": { + "name": "next_attempt_at", + "type": "timestamp with time zone", "primaryKey": false, - "notNull": false + "notNull": true, + "default": "now()" }, - "category": { - "name": "category", + "last_error": { + "name": "last_error", "type": "text", "primaryKey": false, "notNull": false }, - "severity": { - "name": "severity", - "type": "text", + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", "primaryKey": false, - "notNull": false - }, - "severity_source": { - "name": "severity_source", + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "binding_queue_next_attempt_at_idx": { + "name": "binding_queue_next_attempt_at_idx", + "columns": [ + { + "expression": "next_attempt_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "binding_queue_pkey": { + "name": "binding_queue_pkey", + "columns": [ + "record_class", + "record_id", + "effect_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.record_binding": { + "name": "record_binding", + "schema": "conditions", + "columns": { + "record_class": { + "name": "record_class", "type": "text", "primaryKey": false, - "notNull": false + "notNull": true }, - "headline": { - "name": "headline", + "record_id": { + "name": "record_id", "type": "text", "primaryKey": false, - "notNull": false + "notNull": true }, - "description": { - "name": "description", + "effect_id": { + "name": "effect_id", "type": "text", "primaryKey": false, - "notNull": false + "notNull": true, + "default": "''" }, - "metric": { - "name": "metric", + "status": { + "name": "status", "type": "text", "primaryKey": false, - "notNull": false + "notNull": true }, - "value": { - "name": "value", + "confidence": { + "name": "confidence", "type": "double precision", "primaryKey": false, "notNull": false }, - "level": { - "name": "level", + "direction_mode": { + "name": "direction_mode", "type": "text", "primaryKey": false, - "notNull": false + "notNull": true }, - "unit": { - "name": "unit", - "type": "text", + "candidate_count": { + "name": "candidate_count", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "alternative_confidence": { + "name": "alternative_confidence", + "type": "double precision", "primaryKey": false, "notNull": false }, - "aggregation": { - "name": "aggregation", + "reason": { + "name": "reason", "type": "text", "primaryKey": false, "notNull": false }, - "status": { - "name": "status", + "resolver_version": { + "name": "resolver_version", "type": "text", "primaryKey": false, - "notNull": true, - "default": "'active'" + "notNull": true }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", + "geom_hash": { + "name": "geom_hash", + "type": "text", "primaryKey": false, "notNull": true }, - "subject": { - "name": "subject", - "type": "jsonb", + "record_revision": { + "name": "record_revision", + "type": "integer", "primaryKey": false, - "notNull": false + "notNull": true }, - "attributes": { - "name": "attributes", - "type": "jsonb", + "graph_generation": { + "name": "graph_generation", + "type": "text", "primaryKey": false, "notNull": false }, - "valid_from": { - "name": "valid_from", + "bound_at": { + "name": "bound_at", "type": "timestamp with time zone", "primaryKey": false, - "notNull": false + "notNull": true + } + }, + "indexes": { + "record_binding_status_idx": { + "name": "record_binding_status_idx", + "columns": [ + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "record_binding_pkey": { + "name": "record_binding_pkey", + "columns": [ + "record_class", + "record_id", + "effect_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "record_binding_record_class_check": { + "name": "record_binding_record_class_check", + "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false + "record_binding_status_check": { + "name": "record_binding_status_check", + "value": "\"status\" IN ('exact', 'likely', 'ambiguous', 'unresolved', 'no_coverage', 'not_applicable', 'obsolete')" }, - "schedule": { - "name": "schedule", - "type": "jsonb", + "record_binding_direction_mode_check": { + "name": "record_binding_direction_mode_check", + "value": "\"direction_mode\" IN ('single', 'both', 'unknown')" + } + }, + "isRLSEnabled": false + }, + "conditions.record_segment": { + "name": "record_segment", + "schema": "conditions", + "columns": { + "record_class": { + "name": "record_class", + "type": "text", "primaryKey": false, - "notNull": false + "notNull": true }, - "confidence": { - "name": "confidence", + "record_id": { + "name": "record_id", "type": "text", "primaryKey": false, - "notNull": false + "notNull": true }, - "is_forecast": { - "name": "is_forecast", - "type": "boolean", + "effect_id": { + "name": "effect_id", + "type": "text", "primaryKey": false, "notNull": true, - "default": false - }, - "related_ids": { - "name": "related_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false + "default": "''" }, - "origin": { - "name": "origin", - "type": "jsonb", + "seq": { + "name": "seq", + "type": "smallint", "primaryKey": false, "notNull": true }, - "data_updated_at": { - "name": "data_updated_at", - "type": "timestamp with time zone", + "segment_id": { + "name": "segment_id", + "type": "text", "primaryKey": false, "notNull": true }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", + "way_id": { + "name": "way_id", + "type": "bigint", "primaryKey": false, "notNull": true }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", + "dir": { + "name": "dir", + "type": "text", "primaryKey": false, - "notNull": false + "notNull": true }, - "is_stale": { - "name": "is_stale", - "type": "boolean", + "start_fraction": { + "name": "start_fraction", + "type": "double precision", "primaryKey": false, - "notNull": true, - "default": false + "notNull": true }, - "stale_after": { - "name": "stale_after", - "type": "timestamp with time zone", + "end_fraction": { + "name": "end_fraction", + "type": "double precision", "primaryKey": false, - "notNull": false + "notNull": true } }, "indexes": { - "idx_conditions_obs_geom": { - "name": "idx_conditions_obs_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_conditions_obs_domain": { - "name": "idx_conditions_obs_domain", + "record_segment_segment_id_idx": { + "name": "record_segment_segment_id_idx", "columns": [ { - "expression": "domain", + "expression": "segment_id", "isExpression": false, "asc": true, "nulls": "last" @@ -240,33 +306,115 @@ "concurrently": false, "method": "btree", "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "record_segment_pkey": { + "name": "record_segment_pkey", + "columns": [ + "record_class", + "record_id", + "effect_id", + "seq" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.report_evidence": { + "name": "report_evidence", + "schema": "conditions", + "columns": { + "id": { + "name": "id", + "type": "bigint", + "primaryKey": true, + "notNull": true, + "identity": { + "type": "byDefault", + "name": "report_evidence_id_seq", + "schema": "conditions", + "increment": "1", + "startWith": "1", + "minValue": "1", + "maxValue": "9223372036854775807", + "cache": "1", + "cycle": false + } + }, + "record_class": { + "name": "record_class", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "record_id": { + "name": "record_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "component_key": { + "name": "component_key", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "''" + }, + "evidence_kind": { + "name": "evidence_kind", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "actor_key_id": { + "name": "actor_key_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "source_id": { + "name": "source_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "occurred_at": { + "name": "occurred_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true }, - "idx_conditions_obs_dom_type": { - "name": "idx_conditions_obs_dom_type", + "details": { + "name": "details", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + } + }, + "indexes": { + "report_evidence_record_class_record_id_occurred_at_idx": { + "name": "report_evidence_record_class_record_id_occurred_at_idx", "columns": [ { - "expression": "domain", + "expression": "record_class", "isExpression": false, "asc": true, "nulls": "last" }, { - "expression": "type", + "expression": "record_id", "isExpression": false, "asc": true, "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_severity": { - "name": "idx_conditions_obs_severity", - "columns": [ + }, { - "expression": "severity", + "expression": "occurred_at", "isExpression": false, "asc": true, "nulls": "last" @@ -277,26 +425,17 @@ "method": "btree", "with": {} }, - "idx_conditions_obs_metric": { - "name": "idx_conditions_obs_metric", + "report_evidence_actor_key_id_occurred_at_idx": { + "name": "report_evidence_actor_key_id_occurred_at_idx", "columns": [ { - "expression": "metric", + "expression": "actor_key_id", "isExpression": false, "asc": true, "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_valid_to": { - "name": "idx_conditions_obs_valid_to", - "columns": [ + }, { - "expression": "valid_to", + "expression": "occurred_at", "isExpression": false, "asc": true, "nulls": "last" @@ -307,26 +446,106 @@ "method": "btree", "with": {} }, - "idx_conditions_obs_expires": { - "name": "idx_conditions_obs_expires", + "report_evidence_merged_idx": { + "name": "report_evidence_merged_idx", "columns": [ { - "expression": "expires_at", - "isExpression": false, + "expression": "(\"details\" ->> 'merged')", "asc": true, + "isExpression": true, "nulls": "last" } ], "isUnique": false, + "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", "concurrently": false, "method": "btree", "with": {} - }, - "idx_conditions_obs_subject": { - "name": "idx_conditions_obs_subject", + } + }, + "foreignKeys": { + "report_evidence_actor_key_id_fkey": { + "name": "report_evidence_actor_key_id_fkey", + "tableFrom": "report_evidence", + "tableTo": "reporter", + "schemaTo": "conditions", + "columnsFrom": [ + "actor_key_id" + ], + "columnsTo": [ + "key_id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "report_evidence_evidence_kind_check": { + "name": "report_evidence_evidence_kind_check", + "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" + }, + "report_evidence_record_class_check": { + "name": "report_evidence_record_class_check", + "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" + } + }, + "isRLSEnabled": false + }, + "conditions.report_refusal": { + "name": "report_refusal", + "schema": "conditions", + "columns": { + "id": { + "name": "id", + "type": "bigint", + "primaryKey": true, + "notNull": true, + "identity": { + "type": "byDefault", + "name": "report_refusal_id_seq", + "schema": "conditions", + "increment": "1", + "startWith": "1", + "minValue": "1", + "maxValue": "9223372036854775807", + "cache": "1", + "cycle": false + } + }, + "actor_key_id": { + "name": "actor_key_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "cell": { + "name": "cell", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "occurred_at": { + "name": "occurred_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "report_refusal_actor_key_id_occurred_at_idx": { + "name": "report_refusal_actor_key_id_occurred_at_idx", "columns": [ { - "expression": "subject", + "expression": "actor_key_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "occurred_at", "isExpression": false, "asc": true, "nulls": "last" @@ -334,14 +553,112 @@ ], "isUnique": false, "concurrently": false, - "method": "gin", + "method": "btree", "with": {} }, - "idx_conditions_obs_source": { - "name": "idx_conditions_obs_source", + "report_refusal_occurred_at_idx": { + "name": "report_refusal_occurred_at_idx", "columns": [ { - "expression": "source", + "expression": "occurred_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "report_refusal_actor_key_id_fkey": { + "name": "report_refusal_actor_key_id_fkey", + "tableFrom": "report_refusal", + "tableTo": "reporter", + "schemaTo": "conditions", + "columnsFrom": [ + "actor_key_id" + ], + "columnsTo": [ + "key_id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.sub_claim": { + "name": "sub_claim", + "schema": "conditions", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "subject_class": { + "name": "subject_class", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "subject_id": { + "name": "subject_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "claim_type": { + "name": "claim_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "key_id": { + "name": "key_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "reason": { + "name": "reason", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "geom": { + "name": "geom", + "type": "geometry(Point, 4326)", + "primaryKey": false, + "notNull": false + }, + "signature": { + "name": "signature", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "sub_claim_key_id_idx": { + "name": "sub_claim_key_id_idx", + "columns": [ + { + "expression": "key_id", "isExpression": false, "asc": true, "nulls": "last" @@ -353,12 +670,6396 @@ "with": {} } }, + "foreignKeys": { + "sub_claim_key_id_fkey": { + "name": "sub_claim_key_id_fkey", + "tableFrom": "sub_claim", + "tableTo": "reporter", + "schemaTo": "conditions", + "columnsFrom": [ + "key_id" + ], + "columnsTo": [ + "key_id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "sub_claim_subject_class_subject_id_key_id_claim_type_key": { + "name": "sub_claim_subject_class_subject_id_key_id_claim_type_key", + "nullsNotDistinct": false, + "columns": [ + "subject_class", + "subject_id", + "key_id", + "claim_type" + ] + } + }, + "policies": {}, + "checkConstraints": { + "sub_claim_claim_type_check": { + "name": "sub_claim_claim_type_check", + "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" + }, + "sub_claim_subject_class_check": { + "name": "sub_claim_subject_class_check", + "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" + } + }, + "isRLSEnabled": false + }, + "conditions.jma_budget": { + "name": "jma_budget", + "schema": "conditions", + "columns": { + "egress": { + "name": "egress", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "day": { + "name": "day", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "used": { + "name": "used", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "reserved": { + "name": "reserved", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "default": 0 + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "jma_budget_pkey": { + "name": "jma_budget_pkey", + "columns": [ + "egress", + "day" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "jma_budget_nonnegative_check": { + "name": "jma_budget_nonnegative_check", + "value": "\"conditions\".\"jma_budget\".\"used\" >= 0 AND \"conditions\".\"jma_budget\".\"reserved\" >= 0" + } + }, + "isRLSEnabled": false + }, + "conditions.jma_download": { + "name": "jma_download", + "schema": "conditions", + "columns": { + "url": { + "name": "url", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "value": { + "name": "value", + "type": "jsonb", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.jma_state": { + "name": "jma_state", + "schema": "conditions", + "columns": { + "source": { + "name": "source", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "value": { + "name": "value", + "type": "jsonb", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.contributor_receipt": { + "name": "contributor_receipt", + "schema": "conditions", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "version": { + "name": "version", + "type": "smallint", + "primaryKey": false, + "notNull": true + }, + "contributors": { + "name": "contributors", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "provenance": { + "name": "provenance", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false + }, + "conditions.observation_latest": { + "name": "observation_latest", + "schema": "conditions", + "columns": { + "series_id": { + "name": "series_id", + "type": "bigint", + "primaryKey": true, + "notNull": true, + "identity": { + "type": "byDefault", + "name": "observation_latest_series_id_seq", + "schema": "conditions", + "increment": "1", + "startWith": "1", + "minValue": "1", + "maxValue": "9223372036854775807", + "cache": "1", + "cycle": false + } + }, + "effective_from": { + "name": "effective_from", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "since_at": { + "name": "since_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "effective_until": { + "name": "effective_until", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "value_num": { + "name": "value_num", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "confidence_score": { + "name": "confidence_score", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "corroborations": { + "name": "corroborations", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "retention_days": { + "name": "retention_days", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "fused_public": { + "name": "fused_public", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "subject_key": { + "name": "subject_key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "property": { + "name": "property", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "qualifier_key": { + "name": "qualifier_key", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "''" + }, + "source_id": { + "name": "source_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "subject_kind": { + "name": "subject_kind", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "access_mode": { + "name": "access_mode", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "result_type": { + "name": "result_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "template_hash": { + "name": "template_hash", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "feature_id": { + "name": "feature_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "component_key": { + "name": "component_key", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "situation_id": { + "name": "situation_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "crowd_record_id": { + "name": "crowd_record_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "contributor_receipt_id": { + "name": "contributor_receipt_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "value_money": { + "name": "value_money", + "type": "numeric(14, 4)", + "primaryKey": false, + "notNull": false + }, + "value_text": { + "name": "value_text", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "unit": { + "name": "unit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "currency": { + "name": "currency", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "fused_from": { + "name": "fused_from", + "type": "text[]", + "primaryKey": false, + "notNull": false + }, + "fused_sources": { + "name": "fused_sources", + "type": "text[]", + "primaryKey": false, + "notNull": false + }, + "evidence_state": { + "name": "evidence_state", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "geom": { + "name": "geom", + "type": "geometry(Geometry, 4326)", + "primaryKey": false, + "notNull": false + }, + "reading": { + "name": "reading", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "template": { + "name": "template", + "type": "jsonb", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "observation_latest_geom_idx": { + "name": "observation_latest_geom_idx", + "columns": [ + { + "expression": "geom", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "gist", + "with": {} + }, + "observation_latest_property_value_text_idx": { + "name": "observation_latest_property_value_text_idx", + "columns": [ + { + "expression": "property", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "value_text", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "observation_latest_source_id_series_id_idx": { + "name": "observation_latest_source_id_series_id_idx", + "columns": [ + { + "expression": "source_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "series_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "observation_latest_feature_id_component_key_idx": { + "name": "observation_latest_feature_id_component_key_idx", + "columns": [ + { + "expression": "feature_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "component_key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "observation_latest_value_money_fuel_price_idx": { + "name": "observation_latest_value_money_fuel_price_idx", + "columns": [ + { + "expression": "value_money", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", + "concurrently": false, + "method": "btree", + "with": {} + }, + "observation_latest_expires_at_idx": { + "name": "observation_latest_expires_at_idx", + "columns": [ + { + "expression": "expires_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "observation_latest_effective_from_idx": { + "name": "observation_latest_effective_from_idx", + "columns": [ + { + "expression": "effective_from", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "brin", + "with": {} + }, + "observation_latest_crowd_record_id_idx": { + "name": "observation_latest_crowd_record_id_idx", + "columns": [ + { + "expression": "crowd_record_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"conditions\".\"observation_latest\".\"crowd_record_id\" IS NOT NULL", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "observation_latest_series_key": { + "name": "observation_latest_series_key", + "nullsNotDistinct": false, + "columns": [ + "subject_key", + "property", + "qualifier_key", + "source_id" + ] + } + }, + "policies": {}, + "checkConstraints": { + "observation_latest_access_mode_check": { + "name": "observation_latest_access_mode_check", + "value": "\"access_mode\" IN ('bulk', 'on_demand')" + }, + "observation_latest_evidence_state_check": { + "name": "observation_latest_evidence_state_check", + "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" + } + }, + "isRLSEnabled": false + }, + "conditions.observation_rollup_daily": { + "name": "observation_rollup_daily", + "schema": "conditions", + "columns": { + "series_id": { + "name": "series_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "day_utc": { + "name": "day_utc", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "sample_count": { + "name": "sample_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "contributor_receipt_ids": { + "name": "contributor_receipt_ids", + "type": "text[]", + "primaryKey": false, + "notNull": false + }, + "lineage_complete": { + "name": "lineage_complete", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "min": { + "name": "min", + "type": "double precision", + "primaryKey": false, + "notNull": true + }, + "max": { + "name": "max", + "type": "double precision", + "primaryKey": false, + "notNull": true + }, + "mean": { + "name": "mean", + "type": "double precision", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "observation_rollup_daily_day_utc_idx": { + "name": "observation_rollup_daily_day_utc_idx", + "columns": [ + { + "expression": "day_utc", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "observation_rollup_daily_series_id_fkey": { + "name": "observation_rollup_daily_series_id_fkey", + "tableFrom": "observation_rollup_daily", + "tableTo": "observation_latest", + "schemaTo": "conditions", + "columnsFrom": [ + "series_id" + ], + "columnsTo": [ + "series_id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "observation_rollup_daily_pkey": { + "name": "observation_rollup_daily_pkey", + "columns": [ + "series_id", + "day_utc" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.observation_rollup_hourly": { + "name": "observation_rollup_hourly", + "schema": "conditions", + "columns": { + "series_id": { + "name": "series_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "hour_utc": { + "name": "hour_utc", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "min": { + "name": "min", + "type": "double precision", + "primaryKey": false, + "notNull": true + }, + "max": { + "name": "max", + "type": "double precision", + "primaryKey": false, + "notNull": true + }, + "mean": { + "name": "mean", + "type": "double precision", + "primaryKey": false, + "notNull": true + }, + "sample_count": { + "name": "sample_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "lineage_complete": { + "name": "lineage_complete", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "contributor_receipt_ids": { + "name": "contributor_receipt_ids", + "type": "text[]", + "primaryKey": false, + "notNull": false + }, + "bins": { + "name": "bins", + "type": "smallint[]", + "primaryKey": false, + "notNull": false + }, + "counts": { + "name": "counts", + "type": "integer[]", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "observation_rollup_hourly_hour_utc_idx": { + "name": "observation_rollup_hourly_hour_utc_idx", + "columns": [ + { + "expression": "hour_utc", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "observation_rollup_hourly_series_id_fkey": { + "name": "observation_rollup_hourly_series_id_fkey", + "tableFrom": "observation_rollup_hourly", + "tableTo": "observation_latest", + "schemaTo": "conditions", + "columnsFrom": [ + "series_id" + ], + "columnsTo": [ + "series_id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "observation_rollup_hourly_pkey": { + "name": "observation_rollup_hourly_pkey", + "columns": [ + "series_id", + "hour_utc" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.observation_rollup_progress": { + "name": "observation_rollup_progress", + "schema": "conditions", + "columns": { + "period": { + "name": "period", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "finalized_before": { + "name": "finalized_before", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.raw_payload": { + "name": "raw_payload", + "schema": "conditions", + "columns": { + "source_id": { + "name": "source_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hash": { + "name": "hash", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "url_key": { + "name": "url_key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "fetch_id": { + "name": "fetch_id", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "media_type": { + "name": "media_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "bytes_raw": { + "name": "bytes_raw", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "bytes_stored": { + "name": "bytes_stored", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "first_fetched_at": { + "name": "first_fetched_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "last_seen_at": { + "name": "last_seen_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "seen_count": { + "name": "seen_count", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 1 + }, + "tier": { + "name": "tier", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "pinned_reason": { + "name": "pinned_reason", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "storage_key": { + "name": "storage_key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "base_hash": { + "name": "base_hash", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "evicted_at": { + "name": "evicted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "raw_payload_source_id_first_fetched_at_idx": { + "name": "raw_payload_source_id_first_fetched_at_idx", + "columns": [ + { + "expression": "source_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "first_fetched_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "raw_payload_tier_last_seen_at_idx": { + "name": "raw_payload_tier_last_seen_at_idx", + "columns": [ + { + "expression": "tier", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "last_seen_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "raw_payload_source_id_base_hash_idx": { + "name": "raw_payload_source_id_base_hash_idx", + "columns": [ + { + "expression": "source_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "base_hash", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "raw_payload_pkey": { + "name": "raw_payload_pkey", + "columns": [ + "source_id", + "hash" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "raw_payload_tier_check": { + "name": "raw_payload_tier_check", + "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" + } + }, + "isRLSEnabled": false + }, + "conditions.feature": { + "name": "feature", + "schema": "conditions", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "record": { + "name": "record", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "canonical_id": { + "name": "canonical_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "kind": { + "name": "kind", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "subtype": { + "name": "subtype", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "domain": { + "name": "domain", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "temporality": { + "name": "temporality", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "source_id": { + "name": "source_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "source_record_id": { + "name": "source_record_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "origin": { + "name": "origin", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "access_mode": { + "name": "access_mode", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "privacy_class": { + "name": "privacy_class", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "instance_id": { + "name": "instance_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "revision": { + "name": "revision", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "recorded_at": { + "name": "recorded_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "content_hash": { + "name": "content_hash", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "fetched_at": { + "name": "fetched_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "geom": { + "name": "geom", + "type": "geometry(Geometry, 4326)", + "primaryKey": false, + "notNull": false + }, + "country": { + "name": "country", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "subdivision": { + "name": "subdivision", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tombstone_reason": { + "name": "tombstone_reason", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tombstoned_at": { + "name": "tombstoned_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "lifecycle": { + "name": "lifecycle", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "feature_geom_idx": { + "name": "feature_geom_idx", + "columns": [ + { + "expression": "geom", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "gist", + "with": {} + }, + "feature_kind_type_idx": { + "name": "feature_kind_type_idx", + "columns": [ + { + "expression": "kind", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "type", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "feature_source_id_id_idx": { + "name": "feature_source_id_id_idx", + "columns": [ + { + "expression": "source_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "feature_canonical_id_idx": { + "name": "feature_canonical_id_idx", + "columns": [ + { + "expression": "canonical_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "feature_kind_lifecycle_idx": { + "name": "feature_kind_lifecycle_idx", + "columns": [ + { + "expression": "kind", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "lifecycle", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "feature_expires_at_idx": { + "name": "feature_expires_at_idx", + "columns": [ + { + "expression": "expires_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"conditions\".\"feature\".\"tombstoned_at\" IS NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "feature_tombstoned_at_idx": { + "name": "feature_tombstoned_at_idx", + "columns": [ + { + "expression": "tombstoned_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"conditions\".\"feature\".\"tombstoned_at\" IS NOT NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "feature_external_ids_idx": { + "name": "feature_external_ids_idx", + "columns": [ + { + "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", + "asc": true, + "isExpression": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "gin", + "with": { + "fastupdate": "off" + } + }, + "feature_id_rights_revoked_idx": { + "name": "feature_id_rights_revoked_idx", + "columns": [ + { + "expression": "id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"conditions\".\"feature\".\"tombstone_reason\" = 'rights_revoked'", + "concurrently": false, + "method": "btree", + "with": {} + }, + "feature_id_bytes_idx": { + "name": "feature_id_bytes_idx", + "columns": [ + { + "expression": "\"id\" COLLATE \"C\"", + "asc": true, + "isExpression": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "feature_temporality_check": { + "name": "feature_temporality_check", + "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" + }, + "feature_origin_check": { + "name": "feature_origin_check", + "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" + }, + "feature_access_mode_check": { + "name": "feature_access_mode_check", + "value": "\"access_mode\" IN ('bulk', 'on_demand')" + }, + "feature_privacy_class_check": { + "name": "feature_privacy_class_check", + "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" + }, + "feature_tombstone_reason_check": { + "name": "feature_tombstone_reason_check", + "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" + }, + "feature_tombstone_check": { + "name": "feature_tombstone_check", + "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" + }, + "feature_revision_check": { + "name": "feature_revision_check", + "value": "revision > 0" + }, + "feature_lifecycle_check": { + "name": "feature_lifecycle_check", + "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" + } + }, + "isRLSEnabled": false + }, + "conditions.feature_canonical": { + "name": "feature_canonical", + "schema": "conditions", + "columns": { + "canonical_feature_id": { + "name": "canonical_feature_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "survivor_id": { + "name": "survivor_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "member_ids": { + "name": "member_ids", + "type": "text[]", + "primaryKey": false, + "notNull": true + }, + "merged_sources": { + "name": "merged_sources", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "components": { + "name": "components", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[]'::jsonb" + }, + "computed_at": { + "name": "computed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "feature_canonical_member_ids_idx": { + "name": "feature_canonical_member_ids_idx", + "columns": [ + { + "expression": "member_ids", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "gin", + "with": { + "fastupdate": "off" + } + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.feature_component": { + "name": "feature_component", + "schema": "conditions", + "columns": { + "feature_id": { + "name": "feature_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "key": { + "name": "key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "parent_key": { + "name": "parent_key", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "kind": { + "name": "kind", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lifecycle": { + "name": "lifecycle", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "position": { + "name": "position", + "type": "geometry(Point, 4326)", + "primaryKey": false, + "notNull": false + }, + "external_ids": { + "name": "external_ids", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "details": { + "name": "details", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "content_hash": { + "name": "content_hash", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "feature_component_kind_idx": { + "name": "feature_component_kind_idx", + "columns": [ + { + "expression": "kind", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "feature_component_external_ids_idx": { + "name": "feature_component_external_ids_idx", + "columns": [ + { + "expression": "external_ids", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "jsonb_path_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "gin", + "with": {} + } + }, + "foreignKeys": { + "feature_component_feature_id_fkey": { + "name": "feature_component_feature_id_fkey", + "tableFrom": "feature_component", + "tableTo": "feature", + "schemaTo": "conditions", + "columnsFrom": [ + "feature_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "feature_component_pkey": { + "name": "feature_component_pkey", + "columns": [ + "feature_id", + "key" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "feature_component_lifecycle_check": { + "name": "feature_component_lifecycle_check", + "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" + } + }, + "isRLSEnabled": false + }, + "conditions.feature_link": { + "name": "feature_link", + "schema": "conditions", + "columns": { + "a_id": { + "name": "a_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "b_id": { + "name": "b_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "method": { + "name": "method", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "confidence": { + "name": "confidence", + "type": "double precision", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "decided_by": { + "name": "decided_by", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "decided_at": { + "name": "decided_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "feature_link_b_id_idx": { + "name": "feature_link_b_id_idx", + "columns": [ + { + "expression": "b_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "feature_link_pkey": { + "name": "feature_link_pkey", + "columns": [ + "a_id", + "b_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "feature_link_order_check": { + "name": "feature_link_order_check", + "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\" COLLATE \"C\"" + }, + "feature_link_method_check": { + "name": "feature_link_method_check", + "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" + }, + "feature_link_status_check": { + "name": "feature_link_status_check", + "value": "\"status\" IN ('accepted', 'rejected', 'pending')" + } + }, + "isRLSEnabled": false + }, + "conditions.feature_revision": { + "name": "feature_revision", + "schema": "conditions", + "columns": { + "feature_id": { + "name": "feature_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "revision": { + "name": "revision", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "recorded_at": { + "name": "recorded_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "change_kinds": { + "name": "change_kinds", + "type": "text[]", + "primaryKey": false, + "notNull": true + }, + "snapshot": { + "name": "snapshot", + "type": "jsonb", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "feature_revision_recorded_at_idx": { + "name": "feature_revision_recorded_at_idx", + "columns": [ + { + "expression": "recorded_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "feature_revision_feature_id_fkey": { + "name": "feature_revision_feature_id_fkey", + "tableFrom": "feature_revision", + "tableTo": "feature", + "schemaTo": "conditions", + "columnsFrom": [ + "feature_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "feature_revision_pkey": { + "name": "feature_revision_pkey", + "columns": [ + "feature_id", + "revision" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.offer": { + "name": "offer", + "schema": "conditions", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "record": { + "name": "record", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "canonical_id": { + "name": "canonical_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "kind": { + "name": "kind", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "subtype": { + "name": "subtype", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "domain": { + "name": "domain", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "temporality": { + "name": "temporality", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "source_id": { + "name": "source_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "source_record_id": { + "name": "source_record_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "origin": { + "name": "origin", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "access_mode": { + "name": "access_mode", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "privacy_class": { + "name": "privacy_class", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "instance_id": { + "name": "instance_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "revision": { + "name": "revision", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "recorded_at": { + "name": "recorded_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "content_hash": { + "name": "content_hash", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "fetched_at": { + "name": "fetched_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "geom": { + "name": "geom", + "type": "geometry(Geometry, 4326)", + "primaryKey": false, + "notNull": false + }, + "country": { + "name": "country", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "subdivision": { + "name": "subdivision", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tombstone_reason": { + "name": "tombstone_reason", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tombstoned_at": { + "name": "tombstoned_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "subject_class": { + "name": "subject_class", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "subject_id": { + "name": "subject_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "component_key": { + "name": "component_key", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "currency": { + "name": "currency", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "valid_from": { + "name": "valid_from", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "valid_to": { + "name": "valid_to", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "min_price": { + "name": "min_price", + "type": "numeric(14, 4)", + "primaryKey": false, + "notNull": false + }, + "max_price": { + "name": "max_price", + "type": "numeric(14, 4)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "offer_subject_id_component_key_idx": { + "name": "offer_subject_id_component_key_idx", + "columns": [ + { + "expression": "subject_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "component_key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "offer_kind_valid_to_idx": { + "name": "offer_kind_valid_to_idx", + "columns": [ + { + "expression": "kind", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "valid_to", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "offer_geom_idx": { + "name": "offer_geom_idx", + "columns": [ + { + "expression": "geom", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "gist", + "with": {} + }, + "offer_source_id_id_idx": { + "name": "offer_source_id_id_idx", + "columns": [ + { + "expression": "source_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "offer_canonical_id_idx": { + "name": "offer_canonical_id_idx", + "columns": [ + { + "expression": "canonical_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "offer_expires_at_idx": { + "name": "offer_expires_at_idx", + "columns": [ + { + "expression": "expires_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"conditions\".\"offer\".\"tombstoned_at\" IS NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "offer_tombstoned_at_idx": { + "name": "offer_tombstoned_at_idx", + "columns": [ + { + "expression": "tombstoned_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"conditions\".\"offer\".\"tombstoned_at\" IS NOT NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "offer_id_rights_revoked_idx": { + "name": "offer_id_rights_revoked_idx", + "columns": [ + { + "expression": "id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"conditions\".\"offer\".\"tombstone_reason\" = 'rights_revoked'", + "concurrently": false, + "method": "btree", + "with": {} + }, + "offer_id_bytes_idx": { + "name": "offer_id_bytes_idx", + "columns": [ + { + "expression": "\"id\" COLLATE \"C\"", + "asc": true, + "isExpression": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "offer_temporality_check": { + "name": "offer_temporality_check", + "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" + }, + "offer_origin_check": { + "name": "offer_origin_check", + "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" + }, + "offer_access_mode_check": { + "name": "offer_access_mode_check", + "value": "\"access_mode\" IN ('bulk', 'on_demand')" + }, + "offer_privacy_class_check": { + "name": "offer_privacy_class_check", + "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" + }, + "offer_tombstone_reason_check": { + "name": "offer_tombstone_reason_check", + "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" + }, + "offer_tombstone_check": { + "name": "offer_tombstone_check", + "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" + }, + "offer_revision_check": { + "name": "offer_revision_check", + "value": "revision > 0" + }, + "offer_subject_class_check": { + "name": "offer_subject_class_check", + "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" + } + }, + "isRLSEnabled": false + }, + "conditions.offer_revision": { + "name": "offer_revision", + "schema": "conditions", + "columns": { + "offer_id": { + "name": "offer_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "revision": { + "name": "revision", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "recorded_at": { + "name": "recorded_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "change_kinds": { + "name": "change_kinds", + "type": "text[]", + "primaryKey": false, + "notNull": true + }, + "snapshot": { + "name": "snapshot", + "type": "jsonb", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "offer_revision_recorded_at_idx": { + "name": "offer_revision_recorded_at_idx", + "columns": [ + { + "expression": "recorded_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "offer_revision_offer_id_fkey": { + "name": "offer_revision_offer_id_fkey", + "tableFrom": "offer_revision", + "tableTo": "offer", + "schemaTo": "conditions", + "columnsFrom": [ + "offer_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "offer_revision_pkey": { + "name": "offer_revision_pkey", + "columns": [ + "offer_id", + "revision" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.record_relation": { + "name": "record_relation", + "schema": "conditions", + "columns": { + "from_class": { + "name": "from_class", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "from_id": { + "name": "from_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "relation": { + "name": "relation", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "to_class": { + "name": "to_class", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "to_id": { + "name": "to_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "component_key": { + "name": "component_key", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "''" + } + }, + "indexes": { + "record_relation_to_class_to_id_idx": { + "name": "record_relation_to_class_to_id_idx", + "columns": [ + { + "expression": "to_class", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "to_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "record_relation_pkey": { + "name": "record_relation_pkey", + "columns": [ + "from_class", + "from_id", + "relation", + "to_class", + "to_id", + "component_key" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "record_relation_from_class_check": { + "name": "record_relation_from_class_check", + "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" + }, + "record_relation_to_class_check": { + "name": "record_relation_to_class_check", + "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" + }, + "record_relation_relation_check": { + "name": "record_relation_relation_check", + "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" + } + }, + "isRLSEnabled": false + }, + "conditions.situation": { + "name": "situation", + "schema": "conditions", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "record": { + "name": "record", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "canonical_id": { + "name": "canonical_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "kind": { + "name": "kind", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "subtype": { + "name": "subtype", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "domain": { + "name": "domain", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "temporality": { + "name": "temporality", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "source_id": { + "name": "source_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "source_record_id": { + "name": "source_record_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "origin": { + "name": "origin", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "access_mode": { + "name": "access_mode", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "privacy_class": { + "name": "privacy_class", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "instance_id": { + "name": "instance_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "revision": { + "name": "revision", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "recorded_at": { + "name": "recorded_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "content_hash": { + "name": "content_hash", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "fetched_at": { + "name": "fetched_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "geom": { + "name": "geom", + "type": "geometry(Geometry, 4326)", + "primaryKey": false, + "notNull": false + }, + "country": { + "name": "country", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "subdivision": { + "name": "subdivision", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tombstone_reason": { + "name": "tombstone_reason", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tombstoned_at": { + "name": "tombstoned_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "severity": { + "name": "severity", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "severity_level": { + "name": "severity_level", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "certainty": { + "name": "certainty", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "planned": { + "name": "planned", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "validity_status": { + "name": "validity_status", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "valid_from": { + "name": "valid_from", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "valid_to": { + "name": "valid_to", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "group_id": { + "name": "group_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "evidence_state": { + "name": "evidence_state", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "confidence_score": { + "name": "confidence_score", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "routing_eligible": { + "name": "routing_eligible", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "corroborations": { + "name": "corroborations", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "flagged_at": { + "name": "flagged_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "situation_geom_idx": { + "name": "situation_geom_idx", + "columns": [ + { + "expression": "geom", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "gist", + "with": {} + }, + "situation_kind_type_idx": { + "name": "situation_kind_type_idx", + "columns": [ + { + "expression": "kind", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "type", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "situation_source_id_id_idx": { + "name": "situation_source_id_id_idx", + "columns": [ + { + "expression": "source_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "situation_canonical_id_idx": { + "name": "situation_canonical_id_idx", + "columns": [ + { + "expression": "canonical_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "situation_valid_to_idx": { + "name": "situation_valid_to_idx", + "columns": [ + { + "expression": "valid_to", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "situation_expires_at_idx": { + "name": "situation_expires_at_idx", + "columns": [ + { + "expression": "expires_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "situation_group_id_idx": { + "name": "situation_group_id_idx", + "columns": [ + { + "expression": "group_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "situation_evidence_state_crowd_idx": { + "name": "situation_evidence_state_crowd_idx", + "columns": [ + { + "expression": "evidence_state", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", + "concurrently": false, + "method": "btree", + "with": {} + }, + "situation_tombstoned_at_idx": { + "name": "situation_tombstoned_at_idx", + "columns": [ + { + "expression": "tombstoned_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "situation_id_rights_revoked_idx": { + "name": "situation_id_rights_revoked_idx", + "columns": [ + { + "expression": "id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"conditions\".\"situation\".\"tombstone_reason\" = 'rights_revoked'", + "concurrently": false, + "method": "btree", + "with": {} + }, + "situation_id_bytes_idx": { + "name": "situation_id_bytes_idx", + "columns": [ + { + "expression": "\"id\" COLLATE \"C\"", + "asc": true, + "isExpression": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "situation_temporality_check": { + "name": "situation_temporality_check", + "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" + }, + "situation_origin_check": { + "name": "situation_origin_check", + "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" + }, + "situation_access_mode_check": { + "name": "situation_access_mode_check", + "value": "\"access_mode\" IN ('bulk', 'on_demand')" + }, + "situation_privacy_class_check": { + "name": "situation_privacy_class_check", + "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" + }, + "situation_tombstone_reason_check": { + "name": "situation_tombstone_reason_check", + "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" + }, + "situation_tombstone_check": { + "name": "situation_tombstone_check", + "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" + }, + "situation_revision_check": { + "name": "situation_revision_check", + "value": "revision > 0" + }, + "situation_severity_check": { + "name": "situation_severity_check", + "value": "\"severity\" IN ('none', 'minor', 'moderate', 'major', 'critical', 'unknown')" + }, + "situation_severity_level_check": { + "name": "situation_severity_level_check", + "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" + }, + "situation_certainty_check": { + "name": "situation_certainty_check", + "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" + }, + "situation_validity_status_check": { + "name": "situation_validity_status_check", + "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" + }, + "situation_evidence_state_check": { + "name": "situation_evidence_state_check", + "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" + } + }, + "isRLSEnabled": false + }, + "conditions.situation_effect": { + "name": "situation_effect", + "schema": "conditions", + "columns": { + "situation_id": { + "name": "situation_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "effect_id": { + "name": "effect_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "phase_id": { + "name": "phase_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "''" + }, + "kind": { + "name": "kind", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "applicability_kind": { + "name": "applicability_kind", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "normalization": { + "name": "normalization", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "compliance": { + "name": "compliance", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "direction": { + "name": "direction", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "valid_from": { + "name": "valid_from", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "valid_to": { + "name": "valid_to", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "geom": { + "name": "geom", + "type": "geometry(Geometry, 4326)", + "primaryKey": false, + "notNull": false + }, + "value": { + "name": "value", + "type": "jsonb", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "situation_effect_kind_valid_to_idx": { + "name": "situation_effect_kind_valid_to_idx", + "columns": [ + { + "expression": "kind", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "valid_to", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "situation_effect_geom_idx": { + "name": "situation_effect_geom_idx", + "columns": [ + { + "expression": "geom", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "gist", + "with": {} + } + }, + "foreignKeys": { + "situation_effect_situation_id_fkey": { + "name": "situation_effect_situation_id_fkey", + "tableFrom": "situation_effect", + "tableTo": "situation", + "schemaTo": "conditions", + "columnsFrom": [ + "situation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "situation_effect_pkey": { + "name": "situation_effect_pkey", + "columns": [ + "situation_id", + "effect_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "situation_effect_applicability_kind_check": { + "name": "situation_effect_applicability_kind_check", + "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" + }, + "situation_effect_normalization_check": { + "name": "situation_effect_normalization_check", + "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" + }, + "situation_effect_compliance_check": { + "name": "situation_effect_compliance_check", + "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" + } + }, + "isRLSEnabled": false + }, + "conditions.situation_revision": { + "name": "situation_revision", + "schema": "conditions", + "columns": { + "situation_id": { + "name": "situation_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "revision": { + "name": "revision", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "recorded_at": { + "name": "recorded_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "change_kinds": { + "name": "change_kinds", + "type": "text[]", + "primaryKey": false, + "notNull": true + }, + "snapshot": { + "name": "snapshot", + "type": "jsonb", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "situation_revision_recorded_at_idx": { + "name": "situation_revision_recorded_at_idx", + "columns": [ + { + "expression": "recorded_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "situation_revision_situation_id_fkey": { + "name": "situation_revision_situation_id_fkey", + "tableFrom": "situation_revision", + "tableTo": "situation", + "schemaTo": "conditions", + "columnsFrom": [ + "situation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "situation_revision_pkey": { + "name": "situation_revision_pkey", + "columns": [ + "situation_id", + "revision" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.archive_erasure": { + "name": "archive_erasure", + "schema": "conditions", + "columns": { + "key": { + "name": "key", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "applied_at": { + "name": "applied_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.archive_file": { + "name": "archive_file", + "schema": "conditions", + "columns": { + "record_class": { + "name": "record_class", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "file_name": { + "name": "file_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "sha256": { + "name": "sha256", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "bytes": { + "name": "bytes", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "built_at": { + "name": "built_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.block_list": { + "name": "block_list", + "schema": "conditions", + "columns": { + "key_id": { + "name": "key_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "reason": { + "name": "reason", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "created_by": { + "name": "created_by", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.federation_blocklist": { + "name": "federation_blocklist", + "schema": "conditions", + "columns": { + "peer_id": { + "name": "peer_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "reason": { + "name": "reason", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "created_by": { + "name": "created_by", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.federation_instance_key": { + "name": "federation_instance_key", + "schema": "conditions", + "columns": { + "key_id": { + "name": "key_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "public_key": { + "name": "public_key", + "type": "bytea", + "primaryKey": false, + "notNull": true + }, + "private_key_ciphertext": { + "name": "private_key_ciphertext", + "type": "bytea", + "primaryKey": false, + "notNull": true + }, + "private_key_iv": { + "name": "private_key_iv", + "type": "bytea", + "primaryKey": false, + "notNull": true + }, + "private_key_tag": { + "name": "private_key_tag", + "type": "bytea", + "primaryKey": false, + "notNull": true + }, + "multibase": { + "name": "multibase", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "not_before": { + "name": "not_before", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "not_after": { + "name": "not_after", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "endorsed_by": { + "name": "endorsed_by", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "endorsement": { + "name": "endorsement", + "type": "bytea", + "primaryKey": false, + "notNull": false + }, + "endorsement_proof": { + "name": "endorsement_proof", + "type": "bytea", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "federation_instance_key_private_key_check": { + "name": "federation_instance_key_private_key_check", + "value": "(\"private_key_ciphertext\" IS NULL) = (\"private_key_iv\" IS NULL) AND (\"private_key_iv\" IS NULL) = (\"private_key_tag\" IS NULL) AND octet_length(\"private_key_iv\") = 12 AND octet_length(\"private_key_tag\") = 16" + } + }, + "isRLSEnabled": false + }, + "conditions.federation_journal": { + "name": "federation_journal", + "schema": "conditions", + "columns": { + "singleton": { + "name": "singleton", + "type": "boolean", + "primaryKey": true, + "notNull": true, + "default": true + }, + "epoch": { + "name": "epoch", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "started_at": { + "name": "started_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "seen_xid": { + "name": "seen_xid", + "type": "xid8", + "primaryKey": false, + "notNull": true + }, + "timeline_id": { + "name": "timeline_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "database_oid": { + "name": "database_oid", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "system_identifier": { + "name": "system_identifier", + "type": "bigint", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "federation_journal_singleton_check": { + "name": "federation_journal_singleton_check", + "value": "\"conditions\".\"federation_journal\".\"singleton\"" + } + }, + "isRLSEnabled": false + }, + "conditions.federation_lapsed_copy": { + "name": "federation_lapsed_copy", + "schema": "conditions", + "columns": { + "record_class": { + "name": "record_class", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "record_id": { + "name": "record_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "peer_instance_id": { + "name": "peer_instance_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "source_id": { + "name": "source_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "revision": { + "name": "revision", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "lapsed_at": { + "name": "lapsed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "federation_lapsed_copy_peer_instance_id_source_id_idx": { + "name": "federation_lapsed_copy_peer_instance_id_source_id_idx", + "columns": [ + { + "expression": "peer_instance_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "source_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "federation_lapsed_copy_pkey": { + "name": "federation_lapsed_copy_pkey", + "columns": [ + "record_class", + "record_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.federation_outbox": { + "name": "federation_outbox", + "schema": "conditions", + "columns": { + "seq": { + "name": "seq", + "type": "bigint", + "primaryKey": true, + "notNull": true, + "identity": { + "type": "byDefault", + "name": "federation_outbox_seq_seq", + "schema": "conditions", + "increment": "1", + "startWith": "1", + "minValue": "1", + "maxValue": "9223372036854775807", + "cache": "1", + "cycle": false + } + }, + "operation": { + "name": "operation", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "record_class": { + "name": "record_class", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "record_id": { + "name": "record_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "canonical_id": { + "name": "canonical_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "kind": { + "name": "kind", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "domain": { + "name": "domain", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "property": { + "name": "property", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "priority": { + "name": "priority", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "snapshot": { + "name": "snapshot", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "tombstone_reason": { + "name": "tombstone_reason", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "revision": { + "name": "revision", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "txid": { + "name": "txid", + "type": "xid8", + "primaryKey": false, + "notNull": true, + "default": "pg_current_xact_id()" + } + }, + "indexes": { + "federation_outbox_record_class_record_id_seq_idx": { + "name": "federation_outbox_record_class_record_id_seq_idx", + "columns": [ + { + "expression": "record_class", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "record_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "seq", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "federation_outbox_txid_seq_idx": { + "name": "federation_outbox_txid_seq_idx", + "columns": [ + { + "expression": "txid", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "seq", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "federation_outbox_created_at_idx": { + "name": "federation_outbox_created_at_idx", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "federation_outbox_operation_check": { + "name": "federation_outbox_operation_check", + "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete','liveness')" + }, + "federation_outbox_record_class_check": { + "name": "federation_outbox_record_class_check", + "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" + }, + "federation_outbox_delete_shape_check": { + "name": "federation_outbox_delete_shape_check", + "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" + } + }, + "isRLSEnabled": false + }, + "conditions.federation_peer_capabilities": { + "name": "federation_peer_capabilities", + "schema": "conditions", + "columns": { + "peer_instance_id": { + "name": "peer_instance_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "schema_versions": { + "name": "schema_versions", + "type": "text[]", + "primaryKey": false, + "notNull": true + }, + "fetched_at": { + "name": "fetched_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "protocol_version": { + "name": "protocol_version", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.federation_peer_cursor": { + "name": "federation_peer_cursor", + "schema": "conditions", + "columns": { + "peer_instance_id": { + "name": "peer_instance_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "cursor": { + "name": "cursor", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'0.0'" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "archive_built_at": { + "name": "archive_built_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "archive_landed_at": { + "name": "archive_landed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "journal_epoch": { + "name": "journal_epoch", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cursor_reset_at": { + "name": "cursor_reset_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "reconcile_due_since": { + "name": "reconcile_due_since", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "reconcile_class": { + "name": "reconcile_class", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "reconcile_after": { + "name": "reconcile_after", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "reconciled_at": { + "name": "reconciled_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.federation_peer_health": { + "name": "federation_peer_health", + "schema": "conditions", + "columns": { + "peer_id": { + "name": "peer_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "availability_ok": { + "name": "availability_ok", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "availability_fail": { + "name": "availability_fail", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "signature_failures": { + "name": "signature_failures", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "replay_failures": { + "name": "replay_failures", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "schema_failures": { + "name": "schema_failures", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "rate_violations": { + "name": "rate_violations", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "effective_tier_until": { + "name": "effective_tier_until", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.federation_peer_key": { + "name": "federation_peer_key", + "schema": "conditions", + "columns": { + "peer_instance_id": { + "name": "peer_instance_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "key_id": { + "name": "key_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "anchor": { + "name": "anchor", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "learned_at": { + "name": "learned_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "federation_peer_key_pkey": { + "name": "federation_peer_key_pkey", + "columns": [ + "peer_instance_id", + "key_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.federation_source_receipt": { + "name": "federation_source_receipt", + "schema": "conditions", + "columns": { + "peer_instance_id": { + "name": "peer_instance_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "source_id": { + "name": "source_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "last_received_at": { + "name": "last_received_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "liveness_at": { + "name": "liveness_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "cadence_sec": { + "name": "cadence_sec", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "federation_source_receipt_pkey": { + "name": "federation_source_receipt_pkey", + "columns": [ + "peer_instance_id", + "source_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.federation_subscription": { + "name": "federation_subscription", + "schema": "conditions", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "peer_id": { + "name": "peer_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "filter": { + "name": "filter", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + }, + "delivery_mode": { + "name": "delivery_mode", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'pull'" + }, + "inbox_url": { + "name": "inbox_url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cursor": { + "name": "cursor", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'0.0'" + }, + "priority_only": { + "name": "priority_only", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "push_failures": { + "name": "push_failures", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "revision": { + "name": "revision", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'active'" + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now() + interval '30 days'" + } + }, + "indexes": { + "federation_subscription_peer_id_idx": { + "name": "federation_subscription_peer_id_idx", + "columns": [ + { + "expression": "peer_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "federation_subscription_target_key": { + "name": "federation_subscription_target_key", + "columns": [ + { + "expression": "peer_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "delivery_mode", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "coalesce(\"inbox_url\", '')", + "asc": true, + "isExpression": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"conditions\".\"federation_subscription\".\"delivery_mode\" <> 'sse'", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "federation_subscription_delivery_mode_check": { + "name": "federation_subscription_delivery_mode_check", + "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" + }, + "federation_subscription_status_check": { + "name": "federation_subscription_status_check", + "value": "\"conditions\".\"federation_subscription\".\"status\" IN ('active','push_disabled')" + } + }, + "isRLSEnabled": false + }, + "conditions.federation_tombstone": { + "name": "federation_tombstone", + "schema": "conditions", + "columns": { + "canonical_id": { + "name": "canonical_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "peer_instance_id": { + "name": "peer_instance_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "''" + }, + "reason": { + "name": "reason", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "tombstoned_at": { + "name": "tombstoned_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "federation_tombstone_expires_at_idx": { + "name": "federation_tombstone_expires_at_idx", + "columns": [ + { + "expression": "expires_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "federation_tombstone_pkey": { + "name": "federation_tombstone_pkey", + "columns": [ + "canonical_id", + "peer_instance_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "federation_tombstone_reason_check": { + "name": "federation_tombstone_reason_check", + "value": "\"reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" + } + }, + "isRLSEnabled": false + }, + "conditions.geonet_coverage": { + "name": "geonet_coverage", + "schema": "conditions", + "columns": { + "revisions": { + "name": "revisions", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + }, + "source_id": { + "name": "source_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "covered_from": { + "name": "covered_from", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "covered_until": { + "name": "covered_until", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "geonet_coverage_order_check": { + "name": "geonet_coverage_order_check", + "value": "\"conditions\".\"geonet_coverage\".\"covered_from\" < \"conditions\".\"geonet_coverage\".\"covered_until\"" + } + }, + "isRLSEnabled": false + }, + "conditions.issuer_key": { + "name": "issuer_key", + "schema": "conditions", + "columns": { + "key_id": { + "name": "key_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "public_key": { + "name": "public_key", + "type": "bytea", + "primaryKey": false, + "notNull": true + }, + "private_key_ciphertext": { + "name": "private_key_ciphertext", + "type": "bytea", + "primaryKey": false, + "notNull": true + }, + "private_key_iv": { + "name": "private_key_iv", + "type": "bytea", + "primaryKey": false, + "notNull": true + }, + "private_key_tag": { + "name": "private_key_tag", + "type": "bytea", + "primaryKey": false, + "notNull": true + }, + "not_before": { + "name": "not_before", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "not_after": { + "name": "not_after", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "issuer_key_private_key_check": { + "name": "issuer_key_private_key_check", + "value": "(\"private_key_ciphertext\" IS NULL) = (\"private_key_iv\" IS NULL) AND (\"private_key_iv\" IS NULL) = (\"private_key_tag\" IS NULL) AND octet_length(\"private_key_iv\") = 12 AND octet_length(\"private_key_tag\") = 16" + } + }, + "isRLSEnabled": false + }, + "conditions.nsw_rfs_clock": { + "name": "nsw_rfs_clock", + "schema": "conditions", + "columns": { + "source_id": { + "name": "source_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "incident_id": { + "name": "incident_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "sent": { + "name": "sent", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "published": { + "name": "published", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "expiry": { + "name": "expiry", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "nsw_rfs_clock_pkey": { + "name": "nsw_rfs_clock_pkey", + "columns": [ + "source_id", + "incident_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.observation_revision": { + "name": "observation_revision", + "schema": "conditions", + "columns": { + "source_id": { + "name": "source_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "feature_id": { + "name": "feature_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "property": { + "name": "property", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "measured_at": { + "name": "measured_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "rank": { + "name": "rank", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "signature": { + "name": "signature", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "suppressed": { + "name": "suppressed", + "type": "boolean", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "observation_revision_pkey": { + "name": "observation_revision_pkey", + "columns": [ + "source_id", + "feature_id", + "property" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.on_demand_fetch": { + "name": "on_demand_fetch", + "schema": "conditions", + "columns": { + "source_id": { + "name": "source_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "cell": { + "name": "cell", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "fetched_at": { + "name": "fetched_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "retry_at": { + "name": "retry_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "claimed_until": { + "name": "claimed_until", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "on_demand_fetch_pkey": { + "name": "on_demand_fetch_pkey", + "columns": [ + "source_id", + "cell" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "on_demand_fetch_status_check": { + "name": "on_demand_fetch_status_check", + "value": "\"conditions\".\"on_demand_fetch\".\"status\" IN ('pending','fresh','failed')" + } + }, + "isRLSEnabled": false + }, + "conditions.on_demand_quota": { + "name": "on_demand_quota", + "schema": "conditions", + "columns": { + "source_id": { + "name": "source_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "tokens": { + "name": "tokens", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "refilled_at": { + "name": "refilled_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "day": { + "name": "day", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "day_count": { + "name": "day_count", + "type": "integer", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.osm_road": { + "name": "osm_road", + "schema": "conditions", + "columns": { + "way_id": { + "name": "way_id", + "type": "bigint", + "primaryKey": true, + "notNull": true + }, + "geom": { + "name": "geom", + "type": "geometry(Geometry, 4326)", + "primaryKey": false, + "notNull": true + }, + "highway": { + "name": "highway", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "oneway": { + "name": "oneway", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "oneway_reversed": { + "name": "oneway_reversed", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "ref": { + "name": "ref", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "maxspeed_kph": { + "name": "maxspeed_kph", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "region": { + "name": "region", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "import_config_hash": { + "name": "import_config_hash", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "import_provenance": { + "name": "import_provenance", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "imported_at": { + "name": "imported_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "osm_road_geom_idx": { + "name": "osm_road_geom_idx", + "columns": [ + { + "expression": "geom", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "gist", + "with": {} + }, + "osm_road_highway_idx": { + "name": "osm_road_highway_idx", + "columns": [ + { + "expression": "highway", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "osm_road_ref_idx": { + "name": "osm_road_ref_idx", + "columns": [ + { + "expression": "ref", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.public_license_policy": { + "name": "public_license_policy", + "schema": "conditions", + "columns": { + "license": { + "name": "license", + "type": "text", + "primaryKey": true, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.reporter": { + "name": "reporter", + "schema": "conditions", + "columns": { + "key_id": { + "name": "key_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "pub_jwk": { + "name": "pub_jwk", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "reputation_alpha": { + "name": "reputation_alpha", + "type": "double precision", + "primaryKey": false, + "notNull": true + }, + "reputation_beta": { + "name": "reputation_beta", + "type": "double precision", + "primaryKey": false, + "notNull": true + }, + "corroborated_count": { + "name": "corroborated_count", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "trust_signal": { + "name": "trust_signal", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "entitlement_expires_at": { + "name": "entitlement_expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'active'" + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "last_active_at": { + "name": "last_active_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "reporter_last_active_at_idx": { + "name": "reporter_last_active_at_idx", + "columns": [ + { + "expression": "last_active_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "reporter_reputation_alpha_check": { + "name": "reporter_reputation_alpha_check", + "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" + }, + "reporter_reputation_beta_check": { + "name": "reporter_reputation_beta_check", + "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" + }, + "reporter_status_check": { + "name": "reporter_status_check", + "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" + } + }, + "isRLSEnabled": false + }, + "conditions.road_graph_state": { + "name": "road_graph_state", + "schema": "conditions", + "columns": { + "singleton": { + "name": "singleton", + "type": "boolean", + "primaryKey": true, + "notNull": true, + "default": true + }, + "generation": { + "name": "generation", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'ready'" + }, + "regions": { + "name": "regions", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "highway_classes": { + "name": "highway_classes", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "pbf_provenance": { + "name": "pbf_provenance", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "imported_at": { + "name": "imported_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "activated_at": { + "name": "activated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "road_graph_state_singleton_check": { + "name": "road_graph_state_singleton_check", + "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" + } + }, + "isRLSEnabled": false + }, + "conditions.road_segment": { + "name": "road_segment", + "schema": "conditions", + "columns": { + "segment_id": { + "name": "segment_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "way_id": { + "name": "way_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "dir": { + "name": "dir", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "geom": { + "name": "geom", + "type": "geometry(Geometry, 4326)", + "primaryKey": false, + "notNull": true + }, + "highway": { + "name": "highway", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "ref": { + "name": "ref", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "length_m": { + "name": "length_m", + "type": "double precision", + "primaryKey": false, + "notNull": true + }, + "min_zoom": { + "name": "min_zoom", + "type": "smallint", + "primaryKey": false, + "notNull": true + }, + "free_flow_kph": { + "name": "free_flow_kph", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "openlr": { + "name": "openlr", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "computed_at": { + "name": "computed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "road_segment_geom_idx": { + "name": "road_segment_geom_idx", + "columns": [ + { + "expression": "geom", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "gist", + "with": {} + }, + "road_segment_way_id_idx": { + "name": "road_segment_way_id_idx", + "columns": [ + { + "expression": "way_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "road_segment_min_zoom_idx": { + "name": "road_segment_min_zoom_idx", + "columns": [ + { + "expression": "min_zoom", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.secrets_key_check": { + "name": "secrets_key_check", + "schema": "conditions", + "columns": { + "id": { + "name": "id", + "type": "smallint", + "primaryKey": true, + "notNull": true, + "default": 1 + }, + "value_ciphertext": { + "name": "value_ciphertext", + "type": "bytea", + "primaryKey": false, + "notNull": true + }, + "value_iv": { + "name": "value_iv", + "type": "bytea", + "primaryKey": false, + "notNull": true + }, + "value_tag": { + "name": "value_tag", + "type": "bytea", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "secrets_key_check_id_check": { + "name": "secrets_key_check_id_check", + "value": "\"conditions\".\"secrets_key_check\".\"id\" = 1" + }, + "secrets_key_check_value_check": { + "name": "secrets_key_check_value_check", + "value": "(\"value_ciphertext\" IS NULL) = (\"value_iv\" IS NULL) AND (\"value_iv\" IS NULL) = (\"value_tag\" IS NULL) AND octet_length(\"value_iv\") = 12 AND octet_length(\"value_tag\") = 16" + } + }, + "isRLSEnabled": false + }, + "conditions.segment_observation": { + "name": "segment_observation", + "schema": "conditions", + "columns": { + "segment_id": { + "name": "segment_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "source": { + "name": "source", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "source_tier": { + "name": "source_tier", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "current_kph": { + "name": "current_kph", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "free_flow_kph": { + "name": "free_flow_kph", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "speed_ratio": { + "name": "speed_ratio", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "los": { + "name": "los", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "confidence_score": { + "name": "confidence_score", + "type": "double precision", + "primaryKey": false, + "notNull": true + }, + "sample_count": { + "name": "sample_count", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "native_field_sources": { + "name": "native_field_sources", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "field_sources": { + "name": "field_sources", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "field_contributors": { + "name": "field_contributors", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "field_lineage_complete": { + "name": "field_lineage_complete", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "permission_licenses": { + "name": "permission_licenses", + "type": "text[]", + "primaryKey": false, + "notNull": false + }, + "observed_at": { + "name": "observed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "segment_observation_pkey": { + "name": "segment_observation_pkey", + "columns": [ + "segment_id", + "source" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "segment_observation_los_check": { + "name": "segment_observation_los_check", + "value": "\"los\" IN ('free_flow', 'heavy', 'queuing', 'stationary', 'blocked', 'unknown')" + } + }, + "isRLSEnabled": false + }, + "conditions.segment_profile": { + "name": "segment_profile", + "schema": "conditions", + "columns": { + "segment_id": { + "name": "segment_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "dow": { + "name": "dow", + "type": "smallint", + "primaryKey": false, + "notNull": true + }, + "tod_hour": { + "name": "tod_hour", + "type": "smallint", + "primaryKey": false, + "notNull": true + }, + "speed_kph": { + "name": "speed_kph", + "type": "double precision", + "primaryKey": false, + "notNull": true + }, + "sample_count": { + "name": "sample_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "contributor_receipt_ids": { + "name": "contributor_receipt_ids", + "type": "text[]", + "primaryKey": false, + "notNull": false + }, + "lineage_complete": { + "name": "lineage_complete", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "permission_licenses": { + "name": "permission_licenses", + "type": "text[]", + "primaryKey": false, + "notNull": false + }, + "contributing": { + "name": "contributing", + "type": "text[]", + "primaryKey": false, + "notNull": true, + "default": "'{}'::text[]" + }, + "computed_at": { + "name": "computed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "segment_profile_pkey": { + "name": "segment_profile_pkey", + "columns": [ + "segment_id", + "dow", + "tod_hour" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.segment_speed": { + "name": "segment_speed", + "schema": "conditions", + "columns": { + "segment_id": { + "name": "segment_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "current_kph": { + "name": "current_kph", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "free_flow_kph": { + "name": "free_flow_kph", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "speed_ratio": { + "name": "speed_ratio", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "los": { + "name": "los", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "confidence": { + "name": "confidence", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "source_tier": { + "name": "source_tier", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "contributing": { + "name": "contributing", + "type": "text[]", + "primaryKey": false, + "notNull": false + }, + "is_estimated": { + "name": "is_estimated", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "native_field_sources": { + "name": "native_field_sources", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "field_sources": { + "name": "field_sources", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "field_contributors": { + "name": "field_contributors", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "field_lineage_complete": { + "name": "field_lineage_complete", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "permission_licenses": { + "name": "permission_licenses", + "type": "text[]", + "primaryKey": false, + "notNull": false + }, + "observed_at": { + "name": "observed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "segment_speed_los_check": { + "name": "segment_speed_los_check", + "value": "\"los\" IN ('free_flow', 'heavy', 'queuing', 'stationary', 'blocked', 'unknown')" + }, + "segment_speed_confidence_check": { + "name": "segment_speed_confidence_check", + "value": "\"confidence\" IN ('measured', 'estimated')" + } + }, + "isRLSEnabled": false + }, + "conditions.sensor_baseline": { + "name": "sensor_baseline", + "schema": "conditions", + "columns": { + "subject_key": { + "name": "subject_key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "source": { + "name": "source", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "dow_bucket": { + "name": "dow_bucket", + "type": "smallint", + "primaryKey": false, + "notNull": true + }, + "tod_bucket": { + "name": "tod_bucket", + "type": "smallint", + "primaryKey": false, + "notNull": true + }, + "free_flow_kph": { + "name": "free_flow_kph", + "type": "double precision", + "primaryKey": false, + "notNull": true + }, + "method": { + "name": "method", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "contributor_receipt_ids": { + "name": "contributor_receipt_ids", + "type": "text[]", + "primaryKey": false, + "notNull": false + }, + "lineage_complete": { + "name": "lineage_complete", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "permission_licenses": { + "name": "permission_licenses", + "type": "text[]", + "primaryKey": false, + "notNull": false + }, + "contributing": { + "name": "contributing", + "type": "text[]", + "primaryKey": false, + "notNull": false + }, + "sample_count": { + "name": "sample_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "computed_at": { + "name": "computed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "sensor_baseline_source_dow_bucket_tod_bucket_idx": { + "name": "sensor_baseline_source_dow_bucket_tod_bucket_idx", + "columns": [ + { + "expression": "source", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "dow_bucket", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "tod_bucket", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "sensor_baseline_pkey": { + "name": "sensor_baseline_pkey", + "columns": [ + "subject_key", + "dow_bucket", + "tod_bucket", + "method" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.sensor_segment": { + "name": "sensor_segment", + "schema": "conditions", + "columns": { + "subject_key": { + "name": "subject_key", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "segment_id": { + "name": "segment_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "fraction": { + "name": "fraction", + "type": "double precision", + "primaryKey": false, + "notNull": true + }, + "offset_m": { + "name": "offset_m", + "type": "double precision", + "primaryKey": false, + "notNull": true + }, + "bearing_deg": { + "name": "bearing_deg", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "matched_at": { + "name": "matched_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "sensor_segment_segment_id_idx": { + "name": "sensor_segment_segment_id_idx", + "columns": [ + { + "expression": "segment_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.smn_cap_decision": { + "name": "smn_cap_decision", + "schema": "conditions", + "columns": { + "source_id": { + "name": "source_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "decided_at": { + "name": "decided_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "decision": { + "name": "decision", + "type": "jsonb", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.smn_cap_message": { + "name": "smn_cap_message", + "schema": "conditions", + "columns": { + "source_id": { + "name": "source_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "identifier": { + "name": "identifier", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "variant": { + "name": "variant", + "type": "text", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "encode(sha256(body), 'hex')", + "type": "stored" + } + }, + "retrieval": { + "name": "retrieval", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "body": { + "name": "body", + "type": "bytea", + "primaryKey": false, + "notNull": true + }, + "retain_until": { + "name": "retain_until", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "smn_cap_message_pkey": { + "name": "smn_cap_message_pkey", + "columns": [ + "source_id", + "variant" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.source_poll_attempt": { + "name": "source_poll_attempt", + "schema": "conditions", + "columns": { + "id": { + "name": "id", + "type": "bigint", + "primaryKey": true, + "notNull": true, + "identity": { + "type": "byDefault", + "name": "source_poll_attempt_id_seq", + "schema": "conditions", + "increment": "1", + "startWith": "1", + "minValue": "1", + "maxValue": "9223372036854775807", + "cache": "1", + "cycle": false + } + }, + "source": { + "name": "source", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "attempted_at": { + "name": "attempted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "finished_at": { + "name": "finished_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "outcome": { + "name": "outcome", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "network_validated": { + "name": "network_validated", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "published": { + "name": "published", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "active_event_count": { + "name": "active_event_count", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "inserted": { + "name": "inserted", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "updated": { + "name": "updated", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "deleted": { + "name": "deleted", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "rejected": { + "name": "rejected", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "duration_ms": { + "name": "duration_ms", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "partitions_succeeded": { + "name": "partitions_succeeded", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "partitions_failed": { + "name": "partitions_failed", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "partitions_total": { + "name": "partitions_total", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "error": { + "name": "error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "payload_hashes": { + "name": "payload_hashes", + "type": "text[]", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "source_poll_attempt_source_attempted_at_idx": { + "name": "source_poll_attempt_source_attempted_at_idx", + "columns": [ + { + "expression": "source", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "attempted_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "source_poll_attempt_attempted_at_id_idx": { + "name": "source_poll_attempt_attempted_at_id_idx", + "columns": [ + { + "expression": "attempted_at", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.source_shrink": { + "name": "source_shrink", + "schema": "conditions", + "columns": { + "source_id": { + "name": "source_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "scope": { + "name": "scope", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "since": { + "name": "since", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "polls": { + "name": "polls", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "stated": { + "name": "stated", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "held": { + "name": "held", + "type": "integer", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "source_shrink_pkey": { + "name": "source_shrink_pkey", + "columns": [ + "source_id", + "scope" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "source_shrink_scope_check": { + "name": "source_shrink_scope_check", + "value": "\"conditions\".\"source_shrink\".\"scope\" IN ('series','records')" + } + }, + "isRLSEnabled": false + }, + "conditions.source_status": { + "name": "source_status", + "schema": "conditions", + "columns": { + "source": { + "name": "source", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "last_attempt_at": { + "name": "last_attempt_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "last_success_at": { + "name": "last_success_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "last_network_success_at": { + "name": "last_network_success_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "freshness_deadline": { + "name": "freshness_deadline", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "source_published_at": { + "name": "source_published_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "last_publication_at": { + "name": "last_publication_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "publication_revision": { + "name": "publication_revision", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "last_outcome": { + "name": "last_outcome", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "freshness_window_sec": { + "name": "freshness_window_sec", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "last_row_count": { + "name": "last_row_count", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "active_event_count": { + "name": "active_event_count", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "last_inserted": { + "name": "last_inserted", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "last_updated": { + "name": "last_updated", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "last_deleted": { + "name": "last_deleted", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "last_rejected": { + "name": "last_rejected", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "last_duration_ms": { + "name": "last_duration_ms", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "consecutive_failures": { + "name": "consecutive_failures", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "last_error": { + "name": "last_error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "last_error_at": { + "name": "last_error_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "raw_hot_evicted_at": { + "name": "raw_hot_evicted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.spent_token": { + "name": "spent_token", + "schema": "conditions", + "columns": { + "token_hash": { + "name": "token_hash", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "purpose": { + "name": "purpose", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "spent_at": { + "name": "spent_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "spent_token_expires_at_idx": { + "name": "spent_token_expires_at_idx", + "columns": [ + { + "expression": "expires_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.token_quota": { + "name": "token_quota", + "schema": "conditions", + "columns": { + "key_id": { + "name": "key_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "epoch": { + "name": "epoch", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "issued": { + "name": "issued", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + } + }, + "indexes": {}, + "foreignKeys": { + "token_quota_key_id_fkey": { + "name": "token_quota_key_id_fkey", + "tableFrom": "token_quota", + "tableTo": "reporter", + "schemaTo": "conditions", + "columnsFrom": [ + "key_id" + ], + "columnsTo": [ + "key_id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "token_quota_pkey": { + "name": "token_quota_pkey", + "columns": [ + "key_id", + "epoch" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.oauth_grant": { + "name": "oauth_grant", + "schema": "conditions", + "columns": { + "grant_key": { + "name": "grant_key", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "refresh_token_ciphertext": { + "name": "refresh_token_ciphertext", + "type": "bytea", + "primaryKey": false, + "notNull": true + }, + "refresh_token_iv": { + "name": "refresh_token_iv", + "type": "bytea", + "primaryKey": false, + "notNull": true + }, + "refresh_token_tag": { + "name": "refresh_token_tag", + "type": "bytea", + "primaryKey": false, + "notNull": true + }, + "refresh_issued_at": { + "name": "refresh_issued_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "access_token_ciphertext": { + "name": "access_token_ciphertext", + "type": "bytea", + "primaryKey": false, + "notNull": false + }, + "access_token_iv": { + "name": "access_token_iv", + "type": "bytea", + "primaryKey": false, + "notNull": false + }, + "access_token_tag": { + "name": "access_token_tag", + "type": "bytea", + "primaryKey": false, + "notNull": false + }, + "access_expires_at": { + "name": "access_expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "rejected_at": { + "name": "rejected_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "last_error": { + "name": "last_error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "last_error_at": { + "name": "last_error_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "oauth_grant_refresh_token_check": { + "name": "oauth_grant_refresh_token_check", + "value": "(\"refresh_token_ciphertext\" IS NULL) = (\"refresh_token_iv\" IS NULL) AND (\"refresh_token_iv\" IS NULL) = (\"refresh_token_tag\" IS NULL) AND octet_length(\"refresh_token_iv\") = 12 AND octet_length(\"refresh_token_tag\") = 16" + }, + "oauth_grant_access_token_check": { + "name": "oauth_grant_access_token_check", + "value": "(\"access_token_ciphertext\" IS NULL) = (\"access_token_iv\" IS NULL) AND (\"access_token_iv\" IS NULL) = (\"access_token_tag\" IS NULL) AND octet_length(\"access_token_iv\") = 12 AND octet_length(\"access_token_tag\") = 16" + } + }, + "isRLSEnabled": false + }, + "conditions.source": { + "name": "source", + "schema": "conditions", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "domain": { + "name": "domain", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "format": { + "name": "format", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "product": { + "name": "product", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "access_mode": { + "name": "access_mode", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "tier": { + "name": "tier", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "country": { + "name": "country", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "subdivision": { + "name": "subdivision", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "operator": { + "name": "operator", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "license": { + "name": "license", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "license_url": { + "name": "license_url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "attribution": { + "name": "attribution", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "credit_name": { + "name": "credit_name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "credit_url": { + "name": "credit_url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "credit_notice": { + "name": "credit_notice", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "rights": { + "name": "rights", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "restricted": { + "name": "restricted", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restricted_since": { + "name": "restricted_since", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "fusion_restricted": { + "name": "fusion_restricted", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "fusion_tier": { + "name": "fusion_tier", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "fusion_licenses": { + "name": "fusion_licenses", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "federation_restricted": { + "name": "federation_restricted", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "federation_pending": { + "name": "federation_pending", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "cadence_sec": { + "name": "cadence_sec", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "freshness_window_sec": { + "name": "freshness_window_sec", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "raw_retention": { + "name": "raw_retention", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "extras_allow": { + "name": "extras_allow", + "type": "text[]", + "primaryKey": false, + "notNull": true, + "default": "'{}'::text[]" + }, + "extras_federate": { + "name": "extras_federate", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "lane_numbering": { + "name": "lane_numbering", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "parent_source_id": { + "name": "parent_source_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "policy_ids": { + "name": "policy_ids", + "type": "text[]", + "primaryKey": false, + "notNull": false + }, + "selection_state": { + "name": "selection_state", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "source_access_mode_check": { + "name": "source_access_mode_check", + "value": "\"access_mode\" IN ('bulk', 'on_demand')" + }, + "source_tier_check": { + "name": "source_tier_check", + "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" + } + }, + "isRLSEnabled": false } }, "enums": {}, diff --git a/packages/core/drizzle/meta/0001_snapshot.json b/packages/core/drizzle/meta/0001_snapshot.json index 52e8412e9..79d4a4c0d 100644 --- a/packages/core/drizzle/meta/0001_snapshot.json +++ b/packages/core/drizzle/meta/0001_snapshot.json @@ -1,362 +1,6669 @@ { - "id": "975c9908-782e-4c60-9e03-edb2dce11f04", - "prevId": "cbf6629c-cd9e-4fb8-a076-e079b85fa96a", + "id": "686d6a03-471a-4475-a344-a30763e1f6fb", + "prevId": "07985733-6696-46d3-9be2-7d3a6a1af430", "version": "7", "dialect": "postgresql", "tables": { - "conditions.observations": { - "name": "observations", + "conditions.binding_queue": { + "name": "binding_queue", "schema": "conditions", "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", + "record_class": { + "name": "record_class", "type": "text", "primaryKey": false, "notNull": true }, - "source_format": { - "name": "source_format", + "record_id": { + "name": "record_id", "type": "text", "primaryKey": false, "notNull": true }, - "domain": { - "name": "domain", + "effect_id": { + "name": "effect_id", "type": "text", "primaryKey": false, - "notNull": true + "notNull": true, + "default": "''" }, - "kind": { - "name": "kind", - "type": "text", + "record_revision": { + "name": "record_revision", + "type": "integer", "primaryKey": false, "notNull": true }, - "type": { - "name": "type", - "type": "text", + "attempts": { + "name": "attempts", + "type": "integer", "primaryKey": false, - "notNull": false + "notNull": true, + "default": 0 }, - "subtype": { - "name": "subtype", - "type": "text", + "next_attempt_at": { + "name": "next_attempt_at", + "type": "timestamp with time zone", "primaryKey": false, - "notNull": false + "notNull": true, + "default": "now()" }, - "category": { - "name": "category", + "last_error": { + "name": "last_error", "type": "text", "primaryKey": false, "notNull": false }, - "severity": { - "name": "severity", + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "binding_queue_next_attempt_at_idx": { + "name": "binding_queue_next_attempt_at_idx", + "columns": [ + { + "expression": "next_attempt_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "binding_queue_pkey": { + "name": "binding_queue_pkey", + "columns": [ + "record_class", + "record_id", + "effect_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.record_binding": { + "name": "record_binding", + "schema": "conditions", + "columns": { + "record_class": { + "name": "record_class", "type": "text", "primaryKey": false, - "notNull": false + "notNull": true }, - "severity_source": { - "name": "severity_source", + "record_id": { + "name": "record_id", "type": "text", "primaryKey": false, - "notNull": false + "notNull": true }, - "headline": { - "name": "headline", + "effect_id": { + "name": "effect_id", "type": "text", "primaryKey": false, - "notNull": false + "notNull": true, + "default": "''" }, - "description": { - "name": "description", + "status": { + "name": "status", "type": "text", "primaryKey": false, - "notNull": false + "notNull": true }, - "label": { - "name": "label", - "type": "text", + "confidence": { + "name": "confidence", + "type": "double precision", "primaryKey": false, "notNull": false }, - "metric": { - "name": "metric", + "direction_mode": { + "name": "direction_mode", "type": "text", "primaryKey": false, - "notNull": false + "notNull": true }, - "value": { - "name": "value", - "type": "double precision", + "candidate_count": { + "name": "candidate_count", + "type": "integer", "primaryKey": false, - "notNull": false + "notNull": true, + "default": 0 }, - "level": { - "name": "level", - "type": "text", + "alternative_confidence": { + "name": "alternative_confidence", + "type": "double precision", "primaryKey": false, "notNull": false }, - "unit": { - "name": "unit", + "reason": { + "name": "reason", "type": "text", "primaryKey": false, "notNull": false }, - "aggregation": { - "name": "aggregation", + "resolver_version": { + "name": "resolver_version", "type": "text", "primaryKey": false, - "notNull": false + "notNull": true }, - "status": { - "name": "status", + "geom_hash": { + "name": "geom_hash", "type": "text", "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, "notNull": true }, - "subject": { - "name": "subject", - "type": "jsonb", + "record_revision": { + "name": "record_revision", + "type": "integer", "primaryKey": false, - "notNull": false + "notNull": true }, - "attributes": { - "name": "attributes", - "type": "jsonb", + "graph_generation": { + "name": "graph_generation", + "type": "text", "primaryKey": false, "notNull": false }, - "valid_from": { - "name": "valid_from", + "bound_at": { + "name": "bound_at", "type": "timestamp with time zone", "primaryKey": false, - "notNull": false + "notNull": true + } + }, + "indexes": { + "record_binding_status_idx": { + "name": "record_binding_status_idx", + "columns": [ + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "record_binding_pkey": { + "name": "record_binding_pkey", + "columns": [ + "record_class", + "record_id", + "effect_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "record_binding_record_class_check": { + "name": "record_binding_record_class_check", + "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false + "record_binding_status_check": { + "name": "record_binding_status_check", + "value": "\"status\" IN ('exact', 'likely', 'ambiguous', 'unresolved', 'no_coverage', 'not_applicable', 'obsolete')" }, - "schedule": { - "name": "schedule", - "type": "jsonb", + "record_binding_direction_mode_check": { + "name": "record_binding_direction_mode_check", + "value": "\"direction_mode\" IN ('single', 'both', 'unknown')" + } + }, + "isRLSEnabled": false + }, + "conditions.record_segment": { + "name": "record_segment", + "schema": "conditions", + "columns": { + "record_class": { + "name": "record_class", + "type": "text", "primaryKey": false, - "notNull": false + "notNull": true }, - "confidence": { - "name": "confidence", + "record_id": { + "name": "record_id", "type": "text", "primaryKey": false, - "notNull": false + "notNull": true }, - "is_forecast": { - "name": "is_forecast", - "type": "boolean", + "effect_id": { + "name": "effect_id", + "type": "text", "primaryKey": false, "notNull": true, - "default": false - }, - "related_ids": { - "name": "related_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false + "default": "''" }, - "origin": { - "name": "origin", - "type": "jsonb", + "seq": { + "name": "seq", + "type": "smallint", "primaryKey": false, "notNull": true }, - "data_updated_at": { - "name": "data_updated_at", - "type": "timestamp with time zone", + "segment_id": { + "name": "segment_id", + "type": "text", "primaryKey": false, "notNull": true }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", + "way_id": { + "name": "way_id", + "type": "bigint", "primaryKey": false, "notNull": true }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", + "dir": { + "name": "dir", + "type": "text", "primaryKey": false, - "notNull": false + "notNull": true }, - "is_stale": { - "name": "is_stale", - "type": "boolean", + "start_fraction": { + "name": "start_fraction", + "type": "double precision", "primaryKey": false, - "notNull": true, - "default": false + "notNull": true }, - "stale_after": { - "name": "stale_after", - "type": "timestamp with time zone", + "end_fraction": { + "name": "end_fraction", + "type": "double precision", "primaryKey": false, - "notNull": false + "notNull": true } }, "indexes": { - "idx_conditions_obs_geom": { - "name": "idx_conditions_obs_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_conditions_obs_domain": { - "name": "idx_conditions_obs_domain", + "record_segment_segment_id_idx": { + "name": "record_segment_segment_id_idx", "columns": [ { - "expression": "domain", + "expression": "segment_id", "isExpression": false, "asc": true, "nulls": "last" } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "record_segment_pkey": { + "name": "record_segment_pkey", + "columns": [ + "record_class", + "record_id", + "effect_id", + "seq" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.report_evidence": { + "name": "report_evidence", + "schema": "conditions", + "columns": { + "id": { + "name": "id", + "type": "bigint", + "primaryKey": true, + "notNull": true, + "identity": { + "name": "report_evidence_id_seq", + "increment": "1", + "minValue": "1", + "maxValue": "9223372036854775807", + "startWith": "1", + "cache": "1", + "cycle": false, + "schema": "conditions", + "type": "byDefault" + } + }, + "record_class": { + "name": "record_class", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "record_id": { + "name": "record_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "component_key": { + "name": "component_key", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "''" + }, + "evidence_kind": { + "name": "evidence_kind", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "actor_key_id": { + "name": "actor_key_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "source_id": { + "name": "source_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "occurred_at": { + "name": "occurred_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true }, - "idx_conditions_obs_dom_type": { - "name": "idx_conditions_obs_dom_type", + "details": { + "name": "details", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + } + }, + "indexes": { + "report_evidence_record_class_record_id_occurred_at_idx": { + "name": "report_evidence_record_class_record_id_occurred_at_idx", "columns": [ { - "expression": "domain", + "expression": "record_class", "isExpression": false, "asc": true, "nulls": "last" }, { - "expression": "type", + "expression": "record_id", "isExpression": false, "asc": true, "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_severity": { - "name": "idx_conditions_obs_severity", - "columns": [ + }, { - "expression": "severity", + "expression": "occurred_at", "isExpression": false, "asc": true, "nulls": "last" } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, - "idx_conditions_obs_metric": { - "name": "idx_conditions_obs_metric", + "report_evidence_actor_key_id_occurred_at_idx": { + "name": "report_evidence_actor_key_id_occurred_at_idx", "columns": [ { - "expression": "metric", + "expression": "actor_key_id", "isExpression": false, "asc": true, "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_valid_to": { - "name": "idx_conditions_obs_valid_to", - "columns": [ + }, { - "expression": "valid_to", + "expression": "occurred_at", "isExpression": false, "asc": true, "nulls": "last" } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, - "idx_conditions_obs_expires": { - "name": "idx_conditions_obs_expires", + "report_evidence_merged_idx": { + "name": "report_evidence_merged_idx", "columns": [ { - "expression": "expires_at", - "isExpression": false, + "expression": "(\"details\" ->> 'merged')", + "isExpression": true, "asc": true, "nulls": "last" } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} - }, - "idx_conditions_obs_subject": { - "name": "idx_conditions_obs_subject", - "columns": [ - { - "expression": "subject", - "isExpression": false, - "asc": true, - "nulls": "last" - } + "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", + "concurrently": false + } + }, + "foreignKeys": { + "report_evidence_actor_key_id_fkey": { + "name": "report_evidence_actor_key_id_fkey", + "tableFrom": "report_evidence", + "columnsFrom": [ + "actor_key_id" + ], + "tableTo": "reporter", + "schemaTo": "conditions", + "columnsTo": [ + "key_id" + ], + "onUpdate": "no action", + "onDelete": "set null" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "report_evidence_evidence_kind_check": { + "name": "report_evidence_evidence_kind_check", + "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" + }, + "report_evidence_record_class_check": { + "name": "report_evidence_record_class_check", + "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" + } + }, + "isRLSEnabled": false + }, + "conditions.report_refusal": { + "name": "report_refusal", + "schema": "conditions", + "columns": { + "id": { + "name": "id", + "type": "bigint", + "primaryKey": true, + "notNull": true, + "identity": { + "name": "report_refusal_id_seq", + "increment": "1", + "minValue": "1", + "maxValue": "9223372036854775807", + "startWith": "1", + "cache": "1", + "cycle": false, + "schema": "conditions", + "type": "byDefault" + } + }, + "actor_key_id": { + "name": "actor_key_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "cell": { + "name": "cell", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "occurred_at": { + "name": "occurred_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "report_refusal_actor_key_id_occurred_at_idx": { + "name": "report_refusal_actor_key_id_occurred_at_idx", + "columns": [ + { + "expression": "actor_key_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "occurred_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "report_refusal_occurred_at_idx": { + "name": "report_refusal_occurred_at_idx", + "columns": [ + { + "expression": "occurred_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "report_refusal_actor_key_id_fkey": { + "name": "report_refusal_actor_key_id_fkey", + "tableFrom": "report_refusal", + "columnsFrom": [ + "actor_key_id" + ], + "tableTo": "reporter", + "schemaTo": "conditions", + "columnsTo": [ + "key_id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.sub_claim": { + "name": "sub_claim", + "schema": "conditions", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "subject_class": { + "name": "subject_class", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "subject_id": { + "name": "subject_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "claim_type": { + "name": "claim_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "key_id": { + "name": "key_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "reason": { + "name": "reason", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "geom": { + "name": "geom", + "type": "geometry(Point, 4326)", + "primaryKey": false, + "notNull": false + }, + "signature": { + "name": "signature", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "sub_claim_key_id_idx": { + "name": "sub_claim_key_id_idx", + "columns": [ + { + "expression": "key_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "sub_claim_key_id_fkey": { + "name": "sub_claim_key_id_fkey", + "tableFrom": "sub_claim", + "columnsFrom": [ + "key_id" + ], + "tableTo": "reporter", + "schemaTo": "conditions", + "columnsTo": [ + "key_id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "sub_claim_subject_class_subject_id_key_id_claim_type_key": { + "name": "sub_claim_subject_class_subject_id_key_id_claim_type_key", + "columns": [ + "subject_class", + "subject_id", + "key_id", + "claim_type" + ], + "nullsNotDistinct": false + } + }, + "policies": {}, + "checkConstraints": { + "sub_claim_claim_type_check": { + "name": "sub_claim_claim_type_check", + "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" + }, + "sub_claim_subject_class_check": { + "name": "sub_claim_subject_class_check", + "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" + } + }, + "isRLSEnabled": false + }, + "conditions.jma_budget": { + "name": "jma_budget", + "schema": "conditions", + "columns": { + "egress": { + "name": "egress", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "day": { + "name": "day", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "used": { + "name": "used", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "reserved": { + "name": "reserved", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "default": 0 + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "jma_budget_pkey": { + "name": "jma_budget_pkey", + "columns": [ + "egress", + "day" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "jma_budget_nonnegative_check": { + "name": "jma_budget_nonnegative_check", + "value": "\"conditions\".\"jma_budget\".\"used\" >= 0 AND \"conditions\".\"jma_budget\".\"reserved\" >= 0" + } + }, + "isRLSEnabled": false + }, + "conditions.jma_download": { + "name": "jma_download", + "schema": "conditions", + "columns": { + "url": { + "name": "url", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "value": { + "name": "value", + "type": "jsonb", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.jma_state": { + "name": "jma_state", + "schema": "conditions", + "columns": { + "source": { + "name": "source", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "value": { + "name": "value", + "type": "jsonb", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.contributor_receipt": { + "name": "contributor_receipt", + "schema": "conditions", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "version": { + "name": "version", + "type": "smallint", + "primaryKey": false, + "notNull": true + }, + "contributors": { + "name": "contributors", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "provenance": { + "name": "provenance", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.observation_latest": { + "name": "observation_latest", + "schema": "conditions", + "columns": { + "series_id": { + "name": "series_id", + "type": "bigint", + "primaryKey": true, + "notNull": true, + "identity": { + "name": "observation_latest_series_id_seq", + "increment": "1", + "minValue": "1", + "maxValue": "9223372036854775807", + "startWith": "1", + "cache": "1", + "cycle": false, + "schema": "conditions", + "type": "byDefault" + } + }, + "effective_from": { + "name": "effective_from", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "since_at": { + "name": "since_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "effective_until": { + "name": "effective_until", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "value_num": { + "name": "value_num", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "confidence_score": { + "name": "confidence_score", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "corroborations": { + "name": "corroborations", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "retention_days": { + "name": "retention_days", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "fused_public": { + "name": "fused_public", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "subject_key": { + "name": "subject_key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "property": { + "name": "property", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "qualifier_key": { + "name": "qualifier_key", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "''" + }, + "source_id": { + "name": "source_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "subject_kind": { + "name": "subject_kind", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "access_mode": { + "name": "access_mode", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "result_type": { + "name": "result_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "template_hash": { + "name": "template_hash", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "feature_id": { + "name": "feature_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "component_key": { + "name": "component_key", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "situation_id": { + "name": "situation_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "crowd_record_id": { + "name": "crowd_record_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "contributor_receipt_id": { + "name": "contributor_receipt_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "value_money": { + "name": "value_money", + "type": "numeric(14, 4)", + "primaryKey": false, + "notNull": false + }, + "value_text": { + "name": "value_text", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "unit": { + "name": "unit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "currency": { + "name": "currency", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "fused_from": { + "name": "fused_from", + "type": "text[]", + "primaryKey": false, + "notNull": false + }, + "fused_sources": { + "name": "fused_sources", + "type": "text[]", + "primaryKey": false, + "notNull": false + }, + "evidence_state": { + "name": "evidence_state", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "geom": { + "name": "geom", + "type": "geometry(Geometry, 4326)", + "primaryKey": false, + "notNull": false + }, + "reading": { + "name": "reading", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "template": { + "name": "template", + "type": "jsonb", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "observation_latest_geom_idx": { + "name": "observation_latest_geom_idx", + "columns": [ + { + "expression": "geom", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "gist", + "concurrently": false + }, + "observation_latest_property_value_text_idx": { + "name": "observation_latest_property_value_text_idx", + "columns": [ + { + "expression": "property", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "value_text", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "observation_latest_source_id_series_id_idx": { + "name": "observation_latest_source_id_series_id_idx", + "columns": [ + { + "expression": "source_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "series_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "observation_latest_feature_id_component_key_idx": { + "name": "observation_latest_feature_id_component_key_idx", + "columns": [ + { + "expression": "feature_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "component_key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "observation_latest_value_money_fuel_price_idx": { + "name": "observation_latest_value_money_fuel_price_idx", + "columns": [ + { + "expression": "value_money", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", + "concurrently": false + }, + "observation_latest_expires_at_idx": { + "name": "observation_latest_expires_at_idx", + "columns": [ + { + "expression": "expires_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", + "concurrently": false + }, + "observation_latest_effective_from_idx": { + "name": "observation_latest_effective_from_idx", + "columns": [ + { + "expression": "effective_from", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "brin", + "concurrently": false + }, + "observation_latest_crowd_record_id_idx": { + "name": "observation_latest_crowd_record_id_idx", + "columns": [ + { + "expression": "crowd_record_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "where": "\"conditions\".\"observation_latest\".\"crowd_record_id\" IS NOT NULL", + "concurrently": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "observation_latest_series_key": { + "name": "observation_latest_series_key", + "columns": [ + "subject_key", + "property", + "qualifier_key", + "source_id" + ], + "nullsNotDistinct": false + } + }, + "policies": {}, + "checkConstraints": { + "observation_latest_access_mode_check": { + "name": "observation_latest_access_mode_check", + "value": "\"access_mode\" IN ('bulk', 'on_demand')" + }, + "observation_latest_evidence_state_check": { + "name": "observation_latest_evidence_state_check", + "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" + } + }, + "isRLSEnabled": false + }, + "conditions.observation_rollup_daily": { + "name": "observation_rollup_daily", + "schema": "conditions", + "columns": { + "series_id": { + "name": "series_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "day_utc": { + "name": "day_utc", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "sample_count": { + "name": "sample_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "contributor_receipt_ids": { + "name": "contributor_receipt_ids", + "type": "text[]", + "primaryKey": false, + "notNull": false + }, + "lineage_complete": { + "name": "lineage_complete", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "min": { + "name": "min", + "type": "double precision", + "primaryKey": false, + "notNull": true + }, + "max": { + "name": "max", + "type": "double precision", + "primaryKey": false, + "notNull": true + }, + "mean": { + "name": "mean", + "type": "double precision", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "observation_rollup_daily_day_utc_idx": { + "name": "observation_rollup_daily_day_utc_idx", + "columns": [ + { + "expression": "day_utc", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "observation_rollup_daily_series_id_fkey": { + "name": "observation_rollup_daily_series_id_fkey", + "tableFrom": "observation_rollup_daily", + "columnsFrom": [ + "series_id" + ], + "tableTo": "observation_latest", + "schemaTo": "conditions", + "columnsTo": [ + "series_id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": { + "observation_rollup_daily_pkey": { + "name": "observation_rollup_daily_pkey", + "columns": [ + "series_id", + "day_utc" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.observation_rollup_hourly": { + "name": "observation_rollup_hourly", + "schema": "conditions", + "columns": { + "series_id": { + "name": "series_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "hour_utc": { + "name": "hour_utc", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "min": { + "name": "min", + "type": "double precision", + "primaryKey": false, + "notNull": true + }, + "max": { + "name": "max", + "type": "double precision", + "primaryKey": false, + "notNull": true + }, + "mean": { + "name": "mean", + "type": "double precision", + "primaryKey": false, + "notNull": true + }, + "sample_count": { + "name": "sample_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "lineage_complete": { + "name": "lineage_complete", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "contributor_receipt_ids": { + "name": "contributor_receipt_ids", + "type": "text[]", + "primaryKey": false, + "notNull": false + }, + "bins": { + "name": "bins", + "type": "smallint[]", + "primaryKey": false, + "notNull": false + }, + "counts": { + "name": "counts", + "type": "integer[]", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "observation_rollup_hourly_hour_utc_idx": { + "name": "observation_rollup_hourly_hour_utc_idx", + "columns": [ + { + "expression": "hour_utc", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "observation_rollup_hourly_series_id_fkey": { + "name": "observation_rollup_hourly_series_id_fkey", + "tableFrom": "observation_rollup_hourly", + "columnsFrom": [ + "series_id" + ], + "tableTo": "observation_latest", + "schemaTo": "conditions", + "columnsTo": [ + "series_id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": { + "observation_rollup_hourly_pkey": { + "name": "observation_rollup_hourly_pkey", + "columns": [ + "series_id", + "hour_utc" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.observation_rollup_progress": { + "name": "observation_rollup_progress", + "schema": "conditions", + "columns": { + "period": { + "name": "period", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "finalized_before": { + "name": "finalized_before", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.raw_payload": { + "name": "raw_payload", + "schema": "conditions", + "columns": { + "source_id": { + "name": "source_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hash": { + "name": "hash", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "url_key": { + "name": "url_key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "fetch_id": { + "name": "fetch_id", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "media_type": { + "name": "media_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "bytes_raw": { + "name": "bytes_raw", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "bytes_stored": { + "name": "bytes_stored", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "first_fetched_at": { + "name": "first_fetched_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "last_seen_at": { + "name": "last_seen_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "seen_count": { + "name": "seen_count", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 1 + }, + "tier": { + "name": "tier", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "pinned_reason": { + "name": "pinned_reason", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "storage_key": { + "name": "storage_key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "base_hash": { + "name": "base_hash", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "evicted_at": { + "name": "evicted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "raw_payload_source_id_first_fetched_at_idx": { + "name": "raw_payload_source_id_first_fetched_at_idx", + "columns": [ + { + "expression": "source_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "first_fetched_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "raw_payload_tier_last_seen_at_idx": { + "name": "raw_payload_tier_last_seen_at_idx", + "columns": [ + { + "expression": "tier", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "last_seen_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", + "concurrently": false + }, + "raw_payload_source_id_base_hash_idx": { + "name": "raw_payload_source_id_base_hash_idx", + "columns": [ + { + "expression": "source_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "base_hash", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", + "concurrently": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "raw_payload_pkey": { + "name": "raw_payload_pkey", + "columns": [ + "source_id", + "hash" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "raw_payload_tier_check": { + "name": "raw_payload_tier_check", + "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" + } + }, + "isRLSEnabled": false + }, + "conditions.feature": { + "name": "feature", + "schema": "conditions", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "record": { + "name": "record", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "canonical_id": { + "name": "canonical_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "kind": { + "name": "kind", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "subtype": { + "name": "subtype", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "domain": { + "name": "domain", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "temporality": { + "name": "temporality", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "source_id": { + "name": "source_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "source_record_id": { + "name": "source_record_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "origin": { + "name": "origin", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "access_mode": { + "name": "access_mode", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "privacy_class": { + "name": "privacy_class", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "instance_id": { + "name": "instance_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "revision": { + "name": "revision", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "recorded_at": { + "name": "recorded_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "content_hash": { + "name": "content_hash", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "fetched_at": { + "name": "fetched_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "geom": { + "name": "geom", + "type": "geometry(Geometry, 4326)", + "primaryKey": false, + "notNull": false + }, + "country": { + "name": "country", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "subdivision": { + "name": "subdivision", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tombstone_reason": { + "name": "tombstone_reason", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tombstoned_at": { + "name": "tombstoned_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "lifecycle": { + "name": "lifecycle", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "feature_geom_idx": { + "name": "feature_geom_idx", + "columns": [ + { + "expression": "geom", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "gist", + "concurrently": false + }, + "feature_kind_type_idx": { + "name": "feature_kind_type_idx", + "columns": [ + { + "expression": "kind", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "type", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "feature_source_id_id_idx": { + "name": "feature_source_id_id_idx", + "columns": [ + { + "expression": "source_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "feature_canonical_id_idx": { + "name": "feature_canonical_id_idx", + "columns": [ + { + "expression": "canonical_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "feature_kind_lifecycle_idx": { + "name": "feature_kind_lifecycle_idx", + "columns": [ + { + "expression": "kind", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "lifecycle", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "feature_expires_at_idx": { + "name": "feature_expires_at_idx", + "columns": [ + { + "expression": "expires_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "where": "\"conditions\".\"feature\".\"tombstoned_at\" IS NULL", + "concurrently": false + }, + "feature_tombstoned_at_idx": { + "name": "feature_tombstoned_at_idx", + "columns": [ + { + "expression": "tombstoned_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "where": "\"conditions\".\"feature\".\"tombstoned_at\" IS NOT NULL", + "concurrently": false + }, + "feature_external_ids_idx": { + "name": "feature_external_ids_idx", + "columns": [ + { + "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", + "isExpression": true, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": { + "fastupdate": "off" + }, + "method": "gin", + "concurrently": false + }, + "feature_id_rights_revoked_idx": { + "name": "feature_id_rights_revoked_idx", + "columns": [ + { + "expression": "id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "where": "\"conditions\".\"feature\".\"tombstone_reason\" = 'rights_revoked'", + "concurrently": false + }, + "feature_id_bytes_idx": { + "name": "feature_id_bytes_idx", + "columns": [ + { + "expression": "\"id\" COLLATE \"C\"", + "isExpression": true, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "feature_temporality_check": { + "name": "feature_temporality_check", + "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" + }, + "feature_origin_check": { + "name": "feature_origin_check", + "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" + }, + "feature_access_mode_check": { + "name": "feature_access_mode_check", + "value": "\"access_mode\" IN ('bulk', 'on_demand')" + }, + "feature_privacy_class_check": { + "name": "feature_privacy_class_check", + "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" + }, + "feature_tombstone_reason_check": { + "name": "feature_tombstone_reason_check", + "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" + }, + "feature_tombstone_check": { + "name": "feature_tombstone_check", + "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" + }, + "feature_revision_check": { + "name": "feature_revision_check", + "value": "revision > 0" + }, + "feature_lifecycle_check": { + "name": "feature_lifecycle_check", + "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" + } + }, + "isRLSEnabled": false + }, + "conditions.feature_canonical": { + "name": "feature_canonical", + "schema": "conditions", + "columns": { + "canonical_feature_id": { + "name": "canonical_feature_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "survivor_id": { + "name": "survivor_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "member_ids": { + "name": "member_ids", + "type": "text[]", + "primaryKey": false, + "notNull": true + }, + "merged_sources": { + "name": "merged_sources", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "components": { + "name": "components", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[]'::jsonb" + }, + "computed_at": { + "name": "computed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "feature_canonical_member_ids_idx": { + "name": "feature_canonical_member_ids_idx", + "columns": [ + { + "expression": "member_ids", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": { + "fastupdate": "off" + }, + "method": "gin", + "concurrently": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.feature_component": { + "name": "feature_component", + "schema": "conditions", + "columns": { + "feature_id": { + "name": "feature_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "key": { + "name": "key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "parent_key": { + "name": "parent_key", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "kind": { + "name": "kind", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lifecycle": { + "name": "lifecycle", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "position": { + "name": "position", + "type": "geometry(Point, 4326)", + "primaryKey": false, + "notNull": false + }, + "external_ids": { + "name": "external_ids", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "details": { + "name": "details", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "content_hash": { + "name": "content_hash", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "feature_component_kind_idx": { + "name": "feature_component_kind_idx", + "columns": [ + { + "expression": "kind", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "feature_component_external_ids_idx": { + "name": "feature_component_external_ids_idx", + "columns": [ + { + "expression": "external_ids", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "jsonb_path_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "gin", + "concurrently": false + } + }, + "foreignKeys": { + "feature_component_feature_id_fkey": { + "name": "feature_component_feature_id_fkey", + "tableFrom": "feature_component", + "columnsFrom": [ + "feature_id" + ], + "tableTo": "feature", + "schemaTo": "conditions", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": { + "feature_component_pkey": { + "name": "feature_component_pkey", + "columns": [ + "feature_id", + "key" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "feature_component_lifecycle_check": { + "name": "feature_component_lifecycle_check", + "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" + } + }, + "isRLSEnabled": false + }, + "conditions.feature_link": { + "name": "feature_link", + "schema": "conditions", + "columns": { + "a_id": { + "name": "a_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "b_id": { + "name": "b_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "method": { + "name": "method", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "confidence": { + "name": "confidence", + "type": "double precision", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "decided_by": { + "name": "decided_by", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "decided_at": { + "name": "decided_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "feature_link_b_id_idx": { + "name": "feature_link_b_id_idx", + "columns": [ + { + "expression": "b_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "feature_link_pkey": { + "name": "feature_link_pkey", + "columns": [ + "a_id", + "b_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "feature_link_order_check": { + "name": "feature_link_order_check", + "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\" COLLATE \"C\"" + }, + "feature_link_method_check": { + "name": "feature_link_method_check", + "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" + }, + "feature_link_status_check": { + "name": "feature_link_status_check", + "value": "\"status\" IN ('accepted', 'rejected', 'pending')" + } + }, + "isRLSEnabled": false + }, + "conditions.feature_revision": { + "name": "feature_revision", + "schema": "conditions", + "columns": { + "feature_id": { + "name": "feature_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "revision": { + "name": "revision", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "recorded_at": { + "name": "recorded_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "change_kinds": { + "name": "change_kinds", + "type": "text[]", + "primaryKey": false, + "notNull": true + }, + "snapshot": { + "name": "snapshot", + "type": "jsonb", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "feature_revision_recorded_at_idx": { + "name": "feature_revision_recorded_at_idx", + "columns": [ + { + "expression": "recorded_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "feature_revision_feature_id_fkey": { + "name": "feature_revision_feature_id_fkey", + "tableFrom": "feature_revision", + "columnsFrom": [ + "feature_id" + ], + "tableTo": "feature", + "schemaTo": "conditions", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": { + "feature_revision_pkey": { + "name": "feature_revision_pkey", + "columns": [ + "feature_id", + "revision" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.offer": { + "name": "offer", + "schema": "conditions", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "record": { + "name": "record", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "canonical_id": { + "name": "canonical_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "kind": { + "name": "kind", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "subtype": { + "name": "subtype", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "domain": { + "name": "domain", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "temporality": { + "name": "temporality", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "source_id": { + "name": "source_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "source_record_id": { + "name": "source_record_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "origin": { + "name": "origin", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "access_mode": { + "name": "access_mode", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "privacy_class": { + "name": "privacy_class", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "instance_id": { + "name": "instance_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "revision": { + "name": "revision", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "recorded_at": { + "name": "recorded_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "content_hash": { + "name": "content_hash", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "fetched_at": { + "name": "fetched_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "geom": { + "name": "geom", + "type": "geometry(Geometry, 4326)", + "primaryKey": false, + "notNull": false + }, + "country": { + "name": "country", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "subdivision": { + "name": "subdivision", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tombstone_reason": { + "name": "tombstone_reason", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tombstoned_at": { + "name": "tombstoned_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "subject_class": { + "name": "subject_class", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "subject_id": { + "name": "subject_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "component_key": { + "name": "component_key", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "currency": { + "name": "currency", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "valid_from": { + "name": "valid_from", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "valid_to": { + "name": "valid_to", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "min_price": { + "name": "min_price", + "type": "numeric(14, 4)", + "primaryKey": false, + "notNull": false + }, + "max_price": { + "name": "max_price", + "type": "numeric(14, 4)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "offer_subject_id_component_key_idx": { + "name": "offer_subject_id_component_key_idx", + "columns": [ + { + "expression": "subject_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "component_key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "offer_kind_valid_to_idx": { + "name": "offer_kind_valid_to_idx", + "columns": [ + { + "expression": "kind", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "valid_to", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "offer_geom_idx": { + "name": "offer_geom_idx", + "columns": [ + { + "expression": "geom", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "gist", + "concurrently": false + }, + "offer_source_id_id_idx": { + "name": "offer_source_id_id_idx", + "columns": [ + { + "expression": "source_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "offer_canonical_id_idx": { + "name": "offer_canonical_id_idx", + "columns": [ + { + "expression": "canonical_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "offer_expires_at_idx": { + "name": "offer_expires_at_idx", + "columns": [ + { + "expression": "expires_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "where": "\"conditions\".\"offer\".\"tombstoned_at\" IS NULL", + "concurrently": false + }, + "offer_tombstoned_at_idx": { + "name": "offer_tombstoned_at_idx", + "columns": [ + { + "expression": "tombstoned_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "where": "\"conditions\".\"offer\".\"tombstoned_at\" IS NOT NULL", + "concurrently": false + }, + "offer_id_rights_revoked_idx": { + "name": "offer_id_rights_revoked_idx", + "columns": [ + { + "expression": "id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "where": "\"conditions\".\"offer\".\"tombstone_reason\" = 'rights_revoked'", + "concurrently": false + }, + "offer_id_bytes_idx": { + "name": "offer_id_bytes_idx", + "columns": [ + { + "expression": "\"id\" COLLATE \"C\"", + "isExpression": true, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "offer_temporality_check": { + "name": "offer_temporality_check", + "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" + }, + "offer_origin_check": { + "name": "offer_origin_check", + "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" + }, + "offer_access_mode_check": { + "name": "offer_access_mode_check", + "value": "\"access_mode\" IN ('bulk', 'on_demand')" + }, + "offer_privacy_class_check": { + "name": "offer_privacy_class_check", + "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" + }, + "offer_tombstone_reason_check": { + "name": "offer_tombstone_reason_check", + "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" + }, + "offer_tombstone_check": { + "name": "offer_tombstone_check", + "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" + }, + "offer_revision_check": { + "name": "offer_revision_check", + "value": "revision > 0" + }, + "offer_subject_class_check": { + "name": "offer_subject_class_check", + "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" + } + }, + "isRLSEnabled": false + }, + "conditions.offer_revision": { + "name": "offer_revision", + "schema": "conditions", + "columns": { + "offer_id": { + "name": "offer_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "revision": { + "name": "revision", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "recorded_at": { + "name": "recorded_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "change_kinds": { + "name": "change_kinds", + "type": "text[]", + "primaryKey": false, + "notNull": true + }, + "snapshot": { + "name": "snapshot", + "type": "jsonb", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "offer_revision_recorded_at_idx": { + "name": "offer_revision_recorded_at_idx", + "columns": [ + { + "expression": "recorded_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "offer_revision_offer_id_fkey": { + "name": "offer_revision_offer_id_fkey", + "tableFrom": "offer_revision", + "columnsFrom": [ + "offer_id" + ], + "tableTo": "offer", + "schemaTo": "conditions", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": { + "offer_revision_pkey": { + "name": "offer_revision_pkey", + "columns": [ + "offer_id", + "revision" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.record_relation": { + "name": "record_relation", + "schema": "conditions", + "columns": { + "from_class": { + "name": "from_class", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "from_id": { + "name": "from_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "relation": { + "name": "relation", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "to_class": { + "name": "to_class", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "to_id": { + "name": "to_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "component_key": { + "name": "component_key", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "''" + } + }, + "indexes": { + "record_relation_to_class_to_id_idx": { + "name": "record_relation_to_class_to_id_idx", + "columns": [ + { + "expression": "to_class", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "to_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "record_relation_pkey": { + "name": "record_relation_pkey", + "columns": [ + "from_class", + "from_id", + "relation", + "to_class", + "to_id", + "component_key" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "record_relation_from_class_check": { + "name": "record_relation_from_class_check", + "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" + }, + "record_relation_to_class_check": { + "name": "record_relation_to_class_check", + "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" + }, + "record_relation_relation_check": { + "name": "record_relation_relation_check", + "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" + } + }, + "isRLSEnabled": false + }, + "conditions.situation": { + "name": "situation", + "schema": "conditions", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "record": { + "name": "record", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "canonical_id": { + "name": "canonical_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "kind": { + "name": "kind", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "subtype": { + "name": "subtype", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "domain": { + "name": "domain", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "temporality": { + "name": "temporality", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "source_id": { + "name": "source_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "source_record_id": { + "name": "source_record_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "origin": { + "name": "origin", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "access_mode": { + "name": "access_mode", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "privacy_class": { + "name": "privacy_class", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "instance_id": { + "name": "instance_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "revision": { + "name": "revision", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "recorded_at": { + "name": "recorded_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "content_hash": { + "name": "content_hash", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "fetched_at": { + "name": "fetched_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "geom": { + "name": "geom", + "type": "geometry(Geometry, 4326)", + "primaryKey": false, + "notNull": false + }, + "country": { + "name": "country", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "subdivision": { + "name": "subdivision", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tombstone_reason": { + "name": "tombstone_reason", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tombstoned_at": { + "name": "tombstoned_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "severity": { + "name": "severity", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "severity_level": { + "name": "severity_level", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "certainty": { + "name": "certainty", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "planned": { + "name": "planned", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "validity_status": { + "name": "validity_status", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "valid_from": { + "name": "valid_from", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "valid_to": { + "name": "valid_to", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "group_id": { + "name": "group_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "evidence_state": { + "name": "evidence_state", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "confidence_score": { + "name": "confidence_score", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "routing_eligible": { + "name": "routing_eligible", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "corroborations": { + "name": "corroborations", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "flagged_at": { + "name": "flagged_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "situation_geom_idx": { + "name": "situation_geom_idx", + "columns": [ + { + "expression": "geom", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "gist", + "concurrently": false + }, + "situation_kind_type_idx": { + "name": "situation_kind_type_idx", + "columns": [ + { + "expression": "kind", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "type", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "situation_source_id_id_idx": { + "name": "situation_source_id_id_idx", + "columns": [ + { + "expression": "source_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "situation_canonical_id_idx": { + "name": "situation_canonical_id_idx", + "columns": [ + { + "expression": "canonical_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "situation_valid_to_idx": { + "name": "situation_valid_to_idx", + "columns": [ + { + "expression": "valid_to", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "situation_expires_at_idx": { + "name": "situation_expires_at_idx", + "columns": [ + { + "expression": "expires_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "situation_group_id_idx": { + "name": "situation_group_id_idx", + "columns": [ + { + "expression": "group_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "situation_evidence_state_crowd_idx": { + "name": "situation_evidence_state_crowd_idx", + "columns": [ + { + "expression": "evidence_state", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", + "concurrently": false + }, + "situation_tombstoned_at_idx": { + "name": "situation_tombstoned_at_idx", + "columns": [ + { + "expression": "tombstoned_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", + "concurrently": false + }, + "situation_id_rights_revoked_idx": { + "name": "situation_id_rights_revoked_idx", + "columns": [ + { + "expression": "id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "where": "\"conditions\".\"situation\".\"tombstone_reason\" = 'rights_revoked'", + "concurrently": false + }, + "situation_id_bytes_idx": { + "name": "situation_id_bytes_idx", + "columns": [ + { + "expression": "\"id\" COLLATE \"C\"", + "isExpression": true, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "situation_temporality_check": { + "name": "situation_temporality_check", + "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" + }, + "situation_origin_check": { + "name": "situation_origin_check", + "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" + }, + "situation_access_mode_check": { + "name": "situation_access_mode_check", + "value": "\"access_mode\" IN ('bulk', 'on_demand')" + }, + "situation_privacy_class_check": { + "name": "situation_privacy_class_check", + "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" + }, + "situation_tombstone_reason_check": { + "name": "situation_tombstone_reason_check", + "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" + }, + "situation_tombstone_check": { + "name": "situation_tombstone_check", + "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" + }, + "situation_revision_check": { + "name": "situation_revision_check", + "value": "revision > 0" + }, + "situation_severity_check": { + "name": "situation_severity_check", + "value": "\"severity\" IN ('none', 'minor', 'moderate', 'major', 'critical', 'unknown')" + }, + "situation_severity_level_check": { + "name": "situation_severity_level_check", + "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" + }, + "situation_certainty_check": { + "name": "situation_certainty_check", + "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" + }, + "situation_validity_status_check": { + "name": "situation_validity_status_check", + "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" + }, + "situation_evidence_state_check": { + "name": "situation_evidence_state_check", + "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" + } + }, + "isRLSEnabled": false + }, + "conditions.situation_effect": { + "name": "situation_effect", + "schema": "conditions", + "columns": { + "situation_id": { + "name": "situation_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "effect_id": { + "name": "effect_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "phase_id": { + "name": "phase_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "''" + }, + "kind": { + "name": "kind", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "applicability_kind": { + "name": "applicability_kind", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "normalization": { + "name": "normalization", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "compliance": { + "name": "compliance", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "direction": { + "name": "direction", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "valid_from": { + "name": "valid_from", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "valid_to": { + "name": "valid_to", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "geom": { + "name": "geom", + "type": "geometry(Geometry, 4326)", + "primaryKey": false, + "notNull": false + }, + "value": { + "name": "value", + "type": "jsonb", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "situation_effect_kind_valid_to_idx": { + "name": "situation_effect_kind_valid_to_idx", + "columns": [ + { + "expression": "kind", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "valid_to", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "situation_effect_geom_idx": { + "name": "situation_effect_geom_idx", + "columns": [ + { + "expression": "geom", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "gist", + "concurrently": false + } + }, + "foreignKeys": { + "situation_effect_situation_id_fkey": { + "name": "situation_effect_situation_id_fkey", + "tableFrom": "situation_effect", + "columnsFrom": [ + "situation_id" + ], + "tableTo": "situation", + "schemaTo": "conditions", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": { + "situation_effect_pkey": { + "name": "situation_effect_pkey", + "columns": [ + "situation_id", + "effect_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "situation_effect_applicability_kind_check": { + "name": "situation_effect_applicability_kind_check", + "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" + }, + "situation_effect_normalization_check": { + "name": "situation_effect_normalization_check", + "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" + }, + "situation_effect_compliance_check": { + "name": "situation_effect_compliance_check", + "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" + } + }, + "isRLSEnabled": false + }, + "conditions.situation_revision": { + "name": "situation_revision", + "schema": "conditions", + "columns": { + "situation_id": { + "name": "situation_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "revision": { + "name": "revision", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "recorded_at": { + "name": "recorded_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "change_kinds": { + "name": "change_kinds", + "type": "text[]", + "primaryKey": false, + "notNull": true + }, + "snapshot": { + "name": "snapshot", + "type": "jsonb", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "situation_revision_recorded_at_idx": { + "name": "situation_revision_recorded_at_idx", + "columns": [ + { + "expression": "recorded_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "situation_revision_situation_id_fkey": { + "name": "situation_revision_situation_id_fkey", + "tableFrom": "situation_revision", + "columnsFrom": [ + "situation_id" + ], + "tableTo": "situation", + "schemaTo": "conditions", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": { + "situation_revision_pkey": { + "name": "situation_revision_pkey", + "columns": [ + "situation_id", + "revision" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.archive_erasure": { + "name": "archive_erasure", + "schema": "conditions", + "columns": { + "key": { + "name": "key", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "applied_at": { + "name": "applied_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.archive_file": { + "name": "archive_file", + "schema": "conditions", + "columns": { + "record_class": { + "name": "record_class", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "file_name": { + "name": "file_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "sha256": { + "name": "sha256", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "bytes": { + "name": "bytes", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "built_at": { + "name": "built_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.block_list": { + "name": "block_list", + "schema": "conditions", + "columns": { + "key_id": { + "name": "key_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "reason": { + "name": "reason", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "created_by": { + "name": "created_by", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.federation_blocklist": { + "name": "federation_blocklist", + "schema": "conditions", + "columns": { + "peer_id": { + "name": "peer_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "reason": { + "name": "reason", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "created_by": { + "name": "created_by", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.federation_instance_key": { + "name": "federation_instance_key", + "schema": "conditions", + "columns": { + "key_id": { + "name": "key_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "public_key": { + "name": "public_key", + "type": "bytea", + "primaryKey": false, + "notNull": true + }, + "private_key_ciphertext": { + "name": "private_key_ciphertext", + "type": "bytea", + "primaryKey": false, + "notNull": true + }, + "private_key_iv": { + "name": "private_key_iv", + "type": "bytea", + "primaryKey": false, + "notNull": true + }, + "private_key_tag": { + "name": "private_key_tag", + "type": "bytea", + "primaryKey": false, + "notNull": true + }, + "multibase": { + "name": "multibase", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "not_before": { + "name": "not_before", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "not_after": { + "name": "not_after", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "endorsed_by": { + "name": "endorsed_by", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "endorsement": { + "name": "endorsement", + "type": "bytea", + "primaryKey": false, + "notNull": false + }, + "endorsement_proof": { + "name": "endorsement_proof", + "type": "bytea", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "federation_instance_key_private_key_check": { + "name": "federation_instance_key_private_key_check", + "value": "(\"private_key_ciphertext\" IS NULL) = (\"private_key_iv\" IS NULL) AND (\"private_key_iv\" IS NULL) = (\"private_key_tag\" IS NULL) AND octet_length(\"private_key_iv\") = 12 AND octet_length(\"private_key_tag\") = 16" + } + }, + "isRLSEnabled": false + }, + "conditions.federation_journal": { + "name": "federation_journal", + "schema": "conditions", + "columns": { + "singleton": { + "name": "singleton", + "type": "boolean", + "primaryKey": true, + "notNull": true, + "default": true + }, + "epoch": { + "name": "epoch", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "started_at": { + "name": "started_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "seen_xid": { + "name": "seen_xid", + "type": "xid8", + "primaryKey": false, + "notNull": true + }, + "timeline_id": { + "name": "timeline_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "database_oid": { + "name": "database_oid", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "system_identifier": { + "name": "system_identifier", + "type": "bigint", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "federation_journal_singleton_check": { + "name": "federation_journal_singleton_check", + "value": "\"conditions\".\"federation_journal\".\"singleton\"" + } + }, + "isRLSEnabled": false + }, + "conditions.federation_lapsed_copy": { + "name": "federation_lapsed_copy", + "schema": "conditions", + "columns": { + "record_class": { + "name": "record_class", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "record_id": { + "name": "record_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "peer_instance_id": { + "name": "peer_instance_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "source_id": { + "name": "source_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "revision": { + "name": "revision", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "lapsed_at": { + "name": "lapsed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "federation_lapsed_copy_peer_instance_id_source_id_idx": { + "name": "federation_lapsed_copy_peer_instance_id_source_id_idx", + "columns": [ + { + "expression": "peer_instance_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "source_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "federation_lapsed_copy_pkey": { + "name": "federation_lapsed_copy_pkey", + "columns": [ + "record_class", + "record_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.federation_outbox": { + "name": "federation_outbox", + "schema": "conditions", + "columns": { + "seq": { + "name": "seq", + "type": "bigint", + "primaryKey": true, + "notNull": true, + "identity": { + "name": "federation_outbox_seq_seq", + "increment": "1", + "minValue": "1", + "maxValue": "9223372036854775807", + "startWith": "1", + "cache": "1", + "cycle": false, + "schema": "conditions", + "type": "byDefault" + } + }, + "operation": { + "name": "operation", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "record_class": { + "name": "record_class", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "record_id": { + "name": "record_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "canonical_id": { + "name": "canonical_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "kind": { + "name": "kind", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "domain": { + "name": "domain", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "property": { + "name": "property", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "priority": { + "name": "priority", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "snapshot": { + "name": "snapshot", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "tombstone_reason": { + "name": "tombstone_reason", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "revision": { + "name": "revision", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "txid": { + "name": "txid", + "type": "xid8", + "primaryKey": false, + "notNull": true, + "default": "pg_current_xact_id()" + } + }, + "indexes": { + "federation_outbox_record_class_record_id_seq_idx": { + "name": "federation_outbox_record_class_record_id_seq_idx", + "columns": [ + { + "expression": "record_class", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "record_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "seq", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "federation_outbox_txid_seq_idx": { + "name": "federation_outbox_txid_seq_idx", + "columns": [ + { + "expression": "txid", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "seq", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "federation_outbox_created_at_idx": { + "name": "federation_outbox_created_at_idx", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "federation_outbox_operation_check": { + "name": "federation_outbox_operation_check", + "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete','liveness')" + }, + "federation_outbox_record_class_check": { + "name": "federation_outbox_record_class_check", + "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" + }, + "federation_outbox_delete_shape_check": { + "name": "federation_outbox_delete_shape_check", + "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" + } + }, + "isRLSEnabled": false + }, + "conditions.federation_peer_capabilities": { + "name": "federation_peer_capabilities", + "schema": "conditions", + "columns": { + "peer_instance_id": { + "name": "peer_instance_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "schema_versions": { + "name": "schema_versions", + "type": "text[]", + "primaryKey": false, + "notNull": true + }, + "fetched_at": { + "name": "fetched_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "protocol_version": { + "name": "protocol_version", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.federation_peer_cursor": { + "name": "federation_peer_cursor", + "schema": "conditions", + "columns": { + "peer_instance_id": { + "name": "peer_instance_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "cursor": { + "name": "cursor", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'0.0'" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "archive_built_at": { + "name": "archive_built_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "archive_landed_at": { + "name": "archive_landed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "journal_epoch": { + "name": "journal_epoch", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cursor_reset_at": { + "name": "cursor_reset_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "reconcile_due_since": { + "name": "reconcile_due_since", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "reconcile_class": { + "name": "reconcile_class", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "reconcile_after": { + "name": "reconcile_after", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "reconciled_at": { + "name": "reconciled_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.federation_peer_health": { + "name": "federation_peer_health", + "schema": "conditions", + "columns": { + "peer_id": { + "name": "peer_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "availability_ok": { + "name": "availability_ok", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "availability_fail": { + "name": "availability_fail", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "signature_failures": { + "name": "signature_failures", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "replay_failures": { + "name": "replay_failures", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "schema_failures": { + "name": "schema_failures", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "rate_violations": { + "name": "rate_violations", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "effective_tier_until": { + "name": "effective_tier_until", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.federation_peer_key": { + "name": "federation_peer_key", + "schema": "conditions", + "columns": { + "peer_instance_id": { + "name": "peer_instance_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "key_id": { + "name": "key_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "anchor": { + "name": "anchor", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "learned_at": { + "name": "learned_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "federation_peer_key_pkey": { + "name": "federation_peer_key_pkey", + "columns": [ + "peer_instance_id", + "key_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.federation_source_receipt": { + "name": "federation_source_receipt", + "schema": "conditions", + "columns": { + "peer_instance_id": { + "name": "peer_instance_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "source_id": { + "name": "source_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "last_received_at": { + "name": "last_received_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "liveness_at": { + "name": "liveness_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "cadence_sec": { + "name": "cadence_sec", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "federation_source_receipt_pkey": { + "name": "federation_source_receipt_pkey", + "columns": [ + "peer_instance_id", + "source_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.federation_subscription": { + "name": "federation_subscription", + "schema": "conditions", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "peer_id": { + "name": "peer_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "filter": { + "name": "filter", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + }, + "delivery_mode": { + "name": "delivery_mode", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'pull'" + }, + "inbox_url": { + "name": "inbox_url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cursor": { + "name": "cursor", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'0.0'" + }, + "priority_only": { + "name": "priority_only", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "push_failures": { + "name": "push_failures", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "revision": { + "name": "revision", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'active'" + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now() + interval '30 days'" + } + }, + "indexes": { + "federation_subscription_peer_id_idx": { + "name": "federation_subscription_peer_id_idx", + "columns": [ + { + "expression": "peer_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "federation_subscription_target_key": { + "name": "federation_subscription_target_key", + "columns": [ + { + "expression": "peer_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "delivery_mode", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "coalesce(\"inbox_url\", '')", + "isExpression": true, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "with": {}, + "method": "btree", + "where": "\"conditions\".\"federation_subscription\".\"delivery_mode\" <> 'sse'", + "concurrently": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "federation_subscription_delivery_mode_check": { + "name": "federation_subscription_delivery_mode_check", + "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" + }, + "federation_subscription_status_check": { + "name": "federation_subscription_status_check", + "value": "\"conditions\".\"federation_subscription\".\"status\" IN ('active','push_disabled')" + } + }, + "isRLSEnabled": false + }, + "conditions.federation_tombstone": { + "name": "federation_tombstone", + "schema": "conditions", + "columns": { + "canonical_id": { + "name": "canonical_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "peer_instance_id": { + "name": "peer_instance_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "''" + }, + "reason": { + "name": "reason", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "tombstoned_at": { + "name": "tombstoned_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "federation_tombstone_expires_at_idx": { + "name": "federation_tombstone_expires_at_idx", + "columns": [ + { + "expression": "expires_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "federation_tombstone_pkey": { + "name": "federation_tombstone_pkey", + "columns": [ + "canonical_id", + "peer_instance_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "federation_tombstone_reason_check": { + "name": "federation_tombstone_reason_check", + "value": "\"reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" + } + }, + "isRLSEnabled": false + }, + "conditions.geonet_coverage": { + "name": "geonet_coverage", + "schema": "conditions", + "columns": { + "revisions": { + "name": "revisions", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + }, + "source_id": { + "name": "source_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "covered_from": { + "name": "covered_from", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "covered_until": { + "name": "covered_until", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "geonet_coverage_order_check": { + "name": "geonet_coverage_order_check", + "value": "\"conditions\".\"geonet_coverage\".\"covered_from\" < \"conditions\".\"geonet_coverage\".\"covered_until\"" + } + }, + "isRLSEnabled": false + }, + "conditions.issuer_key": { + "name": "issuer_key", + "schema": "conditions", + "columns": { + "key_id": { + "name": "key_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "public_key": { + "name": "public_key", + "type": "bytea", + "primaryKey": false, + "notNull": true + }, + "private_key_ciphertext": { + "name": "private_key_ciphertext", + "type": "bytea", + "primaryKey": false, + "notNull": true + }, + "private_key_iv": { + "name": "private_key_iv", + "type": "bytea", + "primaryKey": false, + "notNull": true + }, + "private_key_tag": { + "name": "private_key_tag", + "type": "bytea", + "primaryKey": false, + "notNull": true + }, + "not_before": { + "name": "not_before", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "not_after": { + "name": "not_after", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "issuer_key_private_key_check": { + "name": "issuer_key_private_key_check", + "value": "(\"private_key_ciphertext\" IS NULL) = (\"private_key_iv\" IS NULL) AND (\"private_key_iv\" IS NULL) = (\"private_key_tag\" IS NULL) AND octet_length(\"private_key_iv\") = 12 AND octet_length(\"private_key_tag\") = 16" + } + }, + "isRLSEnabled": false + }, + "conditions.nsw_rfs_clock": { + "name": "nsw_rfs_clock", + "schema": "conditions", + "columns": { + "source_id": { + "name": "source_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "incident_id": { + "name": "incident_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "sent": { + "name": "sent", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "published": { + "name": "published", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "expiry": { + "name": "expiry", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "nsw_rfs_clock_pkey": { + "name": "nsw_rfs_clock_pkey", + "columns": [ + "source_id", + "incident_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.observation_revision": { + "name": "observation_revision", + "schema": "conditions", + "columns": { + "source_id": { + "name": "source_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "feature_id": { + "name": "feature_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "property": { + "name": "property", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "measured_at": { + "name": "measured_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "rank": { + "name": "rank", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "signature": { + "name": "signature", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "suppressed": { + "name": "suppressed", + "type": "boolean", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "observation_revision_pkey": { + "name": "observation_revision_pkey", + "columns": [ + "source_id", + "feature_id", + "property" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.on_demand_fetch": { + "name": "on_demand_fetch", + "schema": "conditions", + "columns": { + "source_id": { + "name": "source_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "cell": { + "name": "cell", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "fetched_at": { + "name": "fetched_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "retry_at": { + "name": "retry_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "claimed_until": { + "name": "claimed_until", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "on_demand_fetch_pkey": { + "name": "on_demand_fetch_pkey", + "columns": [ + "source_id", + "cell" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "on_demand_fetch_status_check": { + "name": "on_demand_fetch_status_check", + "value": "\"conditions\".\"on_demand_fetch\".\"status\" IN ('pending','fresh','failed')" + } + }, + "isRLSEnabled": false + }, + "conditions.on_demand_quota": { + "name": "on_demand_quota", + "schema": "conditions", + "columns": { + "source_id": { + "name": "source_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "tokens": { + "name": "tokens", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "refilled_at": { + "name": "refilled_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "day": { + "name": "day", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "day_count": { + "name": "day_count", + "type": "integer", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.osm_road": { + "name": "osm_road", + "schema": "conditions", + "columns": { + "way_id": { + "name": "way_id", + "type": "bigint", + "primaryKey": true, + "notNull": true + }, + "geom": { + "name": "geom", + "type": "geometry(Geometry, 4326)", + "primaryKey": false, + "notNull": true + }, + "highway": { + "name": "highway", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "oneway": { + "name": "oneway", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "oneway_reversed": { + "name": "oneway_reversed", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "ref": { + "name": "ref", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "maxspeed_kph": { + "name": "maxspeed_kph", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "region": { + "name": "region", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "import_config_hash": { + "name": "import_config_hash", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "import_provenance": { + "name": "import_provenance", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "imported_at": { + "name": "imported_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "osm_road_geom_idx": { + "name": "osm_road_geom_idx", + "columns": [ + { + "expression": "geom", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "gist", + "concurrently": false + }, + "osm_road_highway_idx": { + "name": "osm_road_highway_idx", + "columns": [ + { + "expression": "highway", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "osm_road_ref_idx": { + "name": "osm_road_ref_idx", + "columns": [ + { + "expression": "ref", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.public_license_policy": { + "name": "public_license_policy", + "schema": "conditions", + "columns": { + "license": { + "name": "license", + "type": "text", + "primaryKey": true, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.reporter": { + "name": "reporter", + "schema": "conditions", + "columns": { + "key_id": { + "name": "key_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "pub_jwk": { + "name": "pub_jwk", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "reputation_alpha": { + "name": "reputation_alpha", + "type": "double precision", + "primaryKey": false, + "notNull": true + }, + "reputation_beta": { + "name": "reputation_beta", + "type": "double precision", + "primaryKey": false, + "notNull": true + }, + "corroborated_count": { + "name": "corroborated_count", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "trust_signal": { + "name": "trust_signal", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "entitlement_expires_at": { + "name": "entitlement_expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'active'" + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "last_active_at": { + "name": "last_active_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "reporter_last_active_at_idx": { + "name": "reporter_last_active_at_idx", + "columns": [ + { + "expression": "last_active_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "reporter_reputation_alpha_check": { + "name": "reporter_reputation_alpha_check", + "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" + }, + "reporter_reputation_beta_check": { + "name": "reporter_reputation_beta_check", + "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" + }, + "reporter_status_check": { + "name": "reporter_status_check", + "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" + } + }, + "isRLSEnabled": false + }, + "conditions.road_graph_state": { + "name": "road_graph_state", + "schema": "conditions", + "columns": { + "singleton": { + "name": "singleton", + "type": "boolean", + "primaryKey": true, + "notNull": true, + "default": true + }, + "generation": { + "name": "generation", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'ready'" + }, + "regions": { + "name": "regions", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "highway_classes": { + "name": "highway_classes", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "pbf_provenance": { + "name": "pbf_provenance", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "imported_at": { + "name": "imported_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "activated_at": { + "name": "activated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "road_graph_state_singleton_check": { + "name": "road_graph_state_singleton_check", + "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" + } + }, + "isRLSEnabled": false + }, + "conditions.road_segment": { + "name": "road_segment", + "schema": "conditions", + "columns": { + "segment_id": { + "name": "segment_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "way_id": { + "name": "way_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "dir": { + "name": "dir", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "geom": { + "name": "geom", + "type": "geometry(Geometry, 4326)", + "primaryKey": false, + "notNull": true + }, + "highway": { + "name": "highway", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "ref": { + "name": "ref", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "length_m": { + "name": "length_m", + "type": "double precision", + "primaryKey": false, + "notNull": true + }, + "min_zoom": { + "name": "min_zoom", + "type": "smallint", + "primaryKey": false, + "notNull": true + }, + "free_flow_kph": { + "name": "free_flow_kph", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "openlr": { + "name": "openlr", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "computed_at": { + "name": "computed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "road_segment_geom_idx": { + "name": "road_segment_geom_idx", + "columns": [ + { + "expression": "geom", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "gist", + "concurrently": false + }, + "road_segment_way_id_idx": { + "name": "road_segment_way_id_idx", + "columns": [ + { + "expression": "way_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "road_segment_min_zoom_idx": { + "name": "road_segment_min_zoom_idx", + "columns": [ + { + "expression": "min_zoom", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.secrets_key_check": { + "name": "secrets_key_check", + "schema": "conditions", + "columns": { + "id": { + "name": "id", + "type": "smallint", + "primaryKey": true, + "notNull": true, + "default": 1 + }, + "value_ciphertext": { + "name": "value_ciphertext", + "type": "bytea", + "primaryKey": false, + "notNull": true + }, + "value_iv": { + "name": "value_iv", + "type": "bytea", + "primaryKey": false, + "notNull": true + }, + "value_tag": { + "name": "value_tag", + "type": "bytea", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "secrets_key_check_id_check": { + "name": "secrets_key_check_id_check", + "value": "\"conditions\".\"secrets_key_check\".\"id\" = 1" + }, + "secrets_key_check_value_check": { + "name": "secrets_key_check_value_check", + "value": "(\"value_ciphertext\" IS NULL) = (\"value_iv\" IS NULL) AND (\"value_iv\" IS NULL) = (\"value_tag\" IS NULL) AND octet_length(\"value_iv\") = 12 AND octet_length(\"value_tag\") = 16" + } + }, + "isRLSEnabled": false + }, + "conditions.segment_observation": { + "name": "segment_observation", + "schema": "conditions", + "columns": { + "segment_id": { + "name": "segment_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "source": { + "name": "source", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "source_tier": { + "name": "source_tier", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "current_kph": { + "name": "current_kph", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "free_flow_kph": { + "name": "free_flow_kph", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "speed_ratio": { + "name": "speed_ratio", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "los": { + "name": "los", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "confidence_score": { + "name": "confidence_score", + "type": "double precision", + "primaryKey": false, + "notNull": true + }, + "sample_count": { + "name": "sample_count", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "native_field_sources": { + "name": "native_field_sources", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "field_sources": { + "name": "field_sources", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "field_contributors": { + "name": "field_contributors", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "field_lineage_complete": { + "name": "field_lineage_complete", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "permission_licenses": { + "name": "permission_licenses", + "type": "text[]", + "primaryKey": false, + "notNull": false + }, + "observed_at": { + "name": "observed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "segment_observation_pkey": { + "name": "segment_observation_pkey", + "columns": [ + "segment_id", + "source" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "segment_observation_los_check": { + "name": "segment_observation_los_check", + "value": "\"los\" IN ('free_flow', 'heavy', 'queuing', 'stationary', 'blocked', 'unknown')" + } + }, + "isRLSEnabled": false + }, + "conditions.segment_profile": { + "name": "segment_profile", + "schema": "conditions", + "columns": { + "segment_id": { + "name": "segment_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "dow": { + "name": "dow", + "type": "smallint", + "primaryKey": false, + "notNull": true + }, + "tod_hour": { + "name": "tod_hour", + "type": "smallint", + "primaryKey": false, + "notNull": true + }, + "speed_kph": { + "name": "speed_kph", + "type": "double precision", + "primaryKey": false, + "notNull": true + }, + "sample_count": { + "name": "sample_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "contributor_receipt_ids": { + "name": "contributor_receipt_ids", + "type": "text[]", + "primaryKey": false, + "notNull": false + }, + "lineage_complete": { + "name": "lineage_complete", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "permission_licenses": { + "name": "permission_licenses", + "type": "text[]", + "primaryKey": false, + "notNull": false + }, + "contributing": { + "name": "contributing", + "type": "text[]", + "primaryKey": false, + "notNull": true, + "default": "'{}'::text[]" + }, + "computed_at": { + "name": "computed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "segment_profile_pkey": { + "name": "segment_profile_pkey", + "columns": [ + "segment_id", + "dow", + "tod_hour" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.segment_speed": { + "name": "segment_speed", + "schema": "conditions", + "columns": { + "segment_id": { + "name": "segment_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "current_kph": { + "name": "current_kph", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "free_flow_kph": { + "name": "free_flow_kph", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "speed_ratio": { + "name": "speed_ratio", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "los": { + "name": "los", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "confidence": { + "name": "confidence", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "source_tier": { + "name": "source_tier", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "contributing": { + "name": "contributing", + "type": "text[]", + "primaryKey": false, + "notNull": false + }, + "is_estimated": { + "name": "is_estimated", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "native_field_sources": { + "name": "native_field_sources", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "field_sources": { + "name": "field_sources", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "field_contributors": { + "name": "field_contributors", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "field_lineage_complete": { + "name": "field_lineage_complete", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "permission_licenses": { + "name": "permission_licenses", + "type": "text[]", + "primaryKey": false, + "notNull": false + }, + "observed_at": { + "name": "observed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "segment_speed_los_check": { + "name": "segment_speed_los_check", + "value": "\"los\" IN ('free_flow', 'heavy', 'queuing', 'stationary', 'blocked', 'unknown')" + }, + "segment_speed_confidence_check": { + "name": "segment_speed_confidence_check", + "value": "\"confidence\" IN ('measured', 'estimated')" + } + }, + "isRLSEnabled": false + }, + "conditions.sensor_baseline": { + "name": "sensor_baseline", + "schema": "conditions", + "columns": { + "subject_key": { + "name": "subject_key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "source": { + "name": "source", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "dow_bucket": { + "name": "dow_bucket", + "type": "smallint", + "primaryKey": false, + "notNull": true + }, + "tod_bucket": { + "name": "tod_bucket", + "type": "smallint", + "primaryKey": false, + "notNull": true + }, + "free_flow_kph": { + "name": "free_flow_kph", + "type": "double precision", + "primaryKey": false, + "notNull": true + }, + "method": { + "name": "method", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "contributor_receipt_ids": { + "name": "contributor_receipt_ids", + "type": "text[]", + "primaryKey": false, + "notNull": false + }, + "lineage_complete": { + "name": "lineage_complete", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "permission_licenses": { + "name": "permission_licenses", + "type": "text[]", + "primaryKey": false, + "notNull": false + }, + "contributing": { + "name": "contributing", + "type": "text[]", + "primaryKey": false, + "notNull": false + }, + "sample_count": { + "name": "sample_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "computed_at": { + "name": "computed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "sensor_baseline_source_dow_bucket_tod_bucket_idx": { + "name": "sensor_baseline_source_dow_bucket_tod_bucket_idx", + "columns": [ + { + "expression": "source", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "dow_bucket", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "tod_bucket", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "sensor_baseline_pkey": { + "name": "sensor_baseline_pkey", + "columns": [ + "subject_key", + "dow_bucket", + "tod_bucket", + "method" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.sensor_segment": { + "name": "sensor_segment", + "schema": "conditions", + "columns": { + "subject_key": { + "name": "subject_key", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "segment_id": { + "name": "segment_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "fraction": { + "name": "fraction", + "type": "double precision", + "primaryKey": false, + "notNull": true + }, + "offset_m": { + "name": "offset_m", + "type": "double precision", + "primaryKey": false, + "notNull": true + }, + "bearing_deg": { + "name": "bearing_deg", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "matched_at": { + "name": "matched_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "sensor_segment_segment_id_idx": { + "name": "sensor_segment_segment_id_idx", + "columns": [ + { + "expression": "segment_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.smn_cap_decision": { + "name": "smn_cap_decision", + "schema": "conditions", + "columns": { + "source_id": { + "name": "source_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "decided_at": { + "name": "decided_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "decision": { + "name": "decision", + "type": "jsonb", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.smn_cap_message": { + "name": "smn_cap_message", + "schema": "conditions", + "columns": { + "source_id": { + "name": "source_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "identifier": { + "name": "identifier", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "variant": { + "name": "variant", + "type": "text", + "primaryKey": false, + "notNull": true, + "generated": { + "type": "stored", + "as": "encode(sha256(body), 'hex')" + } + }, + "retrieval": { + "name": "retrieval", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "body": { + "name": "body", + "type": "bytea", + "primaryKey": false, + "notNull": true + }, + "retain_until": { + "name": "retain_until", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "smn_cap_message_pkey": { + "name": "smn_cap_message_pkey", + "columns": [ + "source_id", + "variant" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.source_poll_attempt": { + "name": "source_poll_attempt", + "schema": "conditions", + "columns": { + "id": { + "name": "id", + "type": "bigint", + "primaryKey": true, + "notNull": true, + "identity": { + "name": "source_poll_attempt_id_seq", + "increment": "1", + "minValue": "1", + "maxValue": "9223372036854775807", + "startWith": "1", + "cache": "1", + "cycle": false, + "schema": "conditions", + "type": "byDefault" + } + }, + "source": { + "name": "source", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "attempted_at": { + "name": "attempted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "finished_at": { + "name": "finished_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "outcome": { + "name": "outcome", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "network_validated": { + "name": "network_validated", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "published": { + "name": "published", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "active_event_count": { + "name": "active_event_count", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "inserted": { + "name": "inserted", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "updated": { + "name": "updated", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "deleted": { + "name": "deleted", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "rejected": { + "name": "rejected", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "duration_ms": { + "name": "duration_ms", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "partitions_succeeded": { + "name": "partitions_succeeded", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "partitions_failed": { + "name": "partitions_failed", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "partitions_total": { + "name": "partitions_total", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "error": { + "name": "error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "payload_hashes": { + "name": "payload_hashes", + "type": "text[]", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "source_poll_attempt_source_attempted_at_idx": { + "name": "source_poll_attempt_source_attempted_at_idx", + "columns": [ + { + "expression": "source", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "attempted_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } ], "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} + "with": {}, + "method": "btree", + "concurrently": false + }, + "source_poll_attempt_attempted_at_id_idx": { + "name": "source_poll_attempt_attempted_at_id_idx", + "columns": [ + { + "expression": "attempted_at", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.source_shrink": { + "name": "source_shrink", + "schema": "conditions", + "columns": { + "source_id": { + "name": "source_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "scope": { + "name": "scope", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "since": { + "name": "since", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "polls": { + "name": "polls", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "stated": { + "name": "stated", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "held": { + "name": "held", + "type": "integer", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "source_shrink_pkey": { + "name": "source_shrink_pkey", + "columns": [ + "source_id", + "scope" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "source_shrink_scope_check": { + "name": "source_shrink_scope_check", + "value": "\"conditions\".\"source_shrink\".\"scope\" IN ('series','records')" + } + }, + "isRLSEnabled": false + }, + "conditions.source_status": { + "name": "source_status", + "schema": "conditions", + "columns": { + "source": { + "name": "source", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "last_attempt_at": { + "name": "last_attempt_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "last_success_at": { + "name": "last_success_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "last_network_success_at": { + "name": "last_network_success_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "freshness_deadline": { + "name": "freshness_deadline", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "source_published_at": { + "name": "source_published_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "last_publication_at": { + "name": "last_publication_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "publication_revision": { + "name": "publication_revision", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "last_outcome": { + "name": "last_outcome", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "freshness_window_sec": { + "name": "freshness_window_sec", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "last_row_count": { + "name": "last_row_count", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "active_event_count": { + "name": "active_event_count", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "last_inserted": { + "name": "last_inserted", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "last_updated": { + "name": "last_updated", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "last_deleted": { + "name": "last_deleted", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "last_rejected": { + "name": "last_rejected", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "last_duration_ms": { + "name": "last_duration_ms", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "consecutive_failures": { + "name": "consecutive_failures", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "last_error": { + "name": "last_error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "last_error_at": { + "name": "last_error_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "raw_hot_evicted_at": { + "name": "raw_hot_evicted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.spent_token": { + "name": "spent_token", + "schema": "conditions", + "columns": { + "token_hash": { + "name": "token_hash", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "purpose": { + "name": "purpose", + "type": "text", + "primaryKey": false, + "notNull": true }, - "idx_conditions_obs_source": { - "name": "idx_conditions_obs_source", + "spent_at": { + "name": "spent_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "spent_token_expires_at_idx": { + "name": "spent_token_expires_at_idx", "columns": [ { - "expression": "source", + "expression": "expires_at", "isExpression": false, "asc": true, "nulls": "last" } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": {}, @@ -365,14 +6672,402 @@ "policies": {}, "checkConstraints": {}, "isRLSEnabled": false + }, + "conditions.token_quota": { + "name": "token_quota", + "schema": "conditions", + "columns": { + "key_id": { + "name": "key_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "epoch": { + "name": "epoch", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "issued": { + "name": "issued", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + } + }, + "indexes": {}, + "foreignKeys": { + "token_quota_key_id_fkey": { + "name": "token_quota_key_id_fkey", + "tableFrom": "token_quota", + "columnsFrom": [ + "key_id" + ], + "tableTo": "reporter", + "schemaTo": "conditions", + "columnsTo": [ + "key_id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": { + "token_quota_pkey": { + "name": "token_quota_pkey", + "columns": [ + "key_id", + "epoch" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "conditions.oauth_grant": { + "name": "oauth_grant", + "schema": "conditions", + "columns": { + "grant_key": { + "name": "grant_key", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "refresh_token_ciphertext": { + "name": "refresh_token_ciphertext", + "type": "bytea", + "primaryKey": false, + "notNull": true + }, + "refresh_token_iv": { + "name": "refresh_token_iv", + "type": "bytea", + "primaryKey": false, + "notNull": true + }, + "refresh_token_tag": { + "name": "refresh_token_tag", + "type": "bytea", + "primaryKey": false, + "notNull": true + }, + "refresh_issued_at": { + "name": "refresh_issued_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "access_token_ciphertext": { + "name": "access_token_ciphertext", + "type": "bytea", + "primaryKey": false, + "notNull": false + }, + "access_token_iv": { + "name": "access_token_iv", + "type": "bytea", + "primaryKey": false, + "notNull": false + }, + "access_token_tag": { + "name": "access_token_tag", + "type": "bytea", + "primaryKey": false, + "notNull": false + }, + "access_expires_at": { + "name": "access_expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "rejected_at": { + "name": "rejected_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "last_error": { + "name": "last_error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "last_error_at": { + "name": "last_error_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "oauth_grant_refresh_token_check": { + "name": "oauth_grant_refresh_token_check", + "value": "(\"refresh_token_ciphertext\" IS NULL) = (\"refresh_token_iv\" IS NULL) AND (\"refresh_token_iv\" IS NULL) = (\"refresh_token_tag\" IS NULL) AND octet_length(\"refresh_token_iv\") = 12 AND octet_length(\"refresh_token_tag\") = 16" + }, + "oauth_grant_access_token_check": { + "name": "oauth_grant_access_token_check", + "value": "(\"access_token_ciphertext\" IS NULL) = (\"access_token_iv\" IS NULL) AND (\"access_token_iv\" IS NULL) = (\"access_token_tag\" IS NULL) AND octet_length(\"access_token_iv\") = 12 AND octet_length(\"access_token_tag\") = 16" + } + }, + "isRLSEnabled": false + }, + "conditions.source": { + "name": "source", + "schema": "conditions", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "domain": { + "name": "domain", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "format": { + "name": "format", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "product": { + "name": "product", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "access_mode": { + "name": "access_mode", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "tier": { + "name": "tier", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "country": { + "name": "country", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "subdivision": { + "name": "subdivision", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "operator": { + "name": "operator", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "license": { + "name": "license", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "license_url": { + "name": "license_url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "attribution": { + "name": "attribution", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "credit_name": { + "name": "credit_name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "credit_url": { + "name": "credit_url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "credit_notice": { + "name": "credit_notice", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "rights": { + "name": "rights", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "restricted": { + "name": "restricted", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restricted_since": { + "name": "restricted_since", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "fusion_restricted": { + "name": "fusion_restricted", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "fusion_tier": { + "name": "fusion_tier", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "fusion_licenses": { + "name": "fusion_licenses", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "federation_restricted": { + "name": "federation_restricted", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "federation_pending": { + "name": "federation_pending", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "cadence_sec": { + "name": "cadence_sec", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "freshness_window_sec": { + "name": "freshness_window_sec", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "raw_retention": { + "name": "raw_retention", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "extras_allow": { + "name": "extras_allow", + "type": "text[]", + "primaryKey": false, + "notNull": true, + "default": "'{}'::text[]" + }, + "extras_federate": { + "name": "extras_federate", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "lane_numbering": { + "name": "lane_numbering", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "parent_source_id": { + "name": "parent_source_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "policy_ids": { + "name": "policy_ids", + "type": "text[]", + "primaryKey": false, + "notNull": false + }, + "selection_state": { + "name": "selection_state", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "source_access_mode_check": { + "name": "source_access_mode_check", + "value": "\"access_mode\" IN ('bulk', 'on_demand')" + }, + "source_tier_check": { + "name": "source_tier_check", + "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" + } + }, + "isRLSEnabled": false } }, "enums": {}, "schemas": {}, + "views": {}, "sequences": {}, "roles": {}, "policies": {}, - "views": {}, "_meta": { "columns": {}, "schemas": {}, diff --git a/packages/core/drizzle/meta/0002_snapshot.json b/packages/core/drizzle/meta/0002_snapshot.json deleted file mode 100644 index dcf93ea56..000000000 --- a/packages/core/drizzle/meta/0002_snapshot.json +++ /dev/null @@ -1,593 +0,0 @@ -{ - "id": "c32f1b54-ccd0-4457-9cdb-76cd4852c434", - "prevId": "975c9908-782e-4c60-9e03-edb2dce11f04", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.observations": { - "name": "observations", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_format": { - "name": "source_format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity_source": { - "name": "severity_source", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "headline": { - "name": "headline", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "metric": { - "name": "metric", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "level": { - "name": "level", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "aggregation": { - "name": "aggregation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "subject": { - "name": "subject", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "attributes": { - "name": "attributes", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "schedule": { - "name": "schedule", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_forecast": { - "name": "is_forecast", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "related_ids": { - "name": "related_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "origin": { - "name": "origin", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "data_updated_at": { - "name": "data_updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "is_stale": { - "name": "is_stale", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "stale_after": { - "name": "stale_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_conditions_obs_geom": { - "name": "idx_conditions_obs_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_conditions_obs_domain": { - "name": "idx_conditions_obs_domain", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_dom_type": { - "name": "idx_conditions_obs_dom_type", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_severity": { - "name": "idx_conditions_obs_severity", - "columns": [ - { - "expression": "severity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_metric": { - "name": "idx_conditions_obs_metric", - "columns": [ - { - "expression": "metric", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_valid_to": { - "name": "idx_conditions_obs_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_expires": { - "name": "idx_conditions_obs_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_subject": { - "name": "idx_conditions_obs_subject", - "columns": [ - { - "expression": "subject", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_source": { - "name": "idx_conditions_obs_source", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "sensor_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_sample": { - "name": "sensor_speed_sample", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_sample_key_bucket": { - "name": "idx_sensor_sample_key_bucket", - "columns": [ - { - "expression": "sensor_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_hour", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sensor_sample_observed": { - "name": "idx_sensor_sample_observed", - "columns": [ - { - "expression": "observed_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_sensor_sample_key_observed": { - "name": "uq_sensor_sample_key_observed", - "nullsNotDistinct": false, - "columns": [ - "sensor_key", - "observed_at" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0003_snapshot.json b/packages/core/drizzle/meta/0003_snapshot.json deleted file mode 100644 index dfea5e9dd..000000000 --- a/packages/core/drizzle/meta/0003_snapshot.json +++ /dev/null @@ -1,655 +0,0 @@ -{ - "id": "44062121-31d5-433f-935d-0279ed050e3f", - "prevId": "c32f1b54-ccd0-4457-9cdb-76cd4852c434", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.observations": { - "name": "observations", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_format": { - "name": "source_format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity_source": { - "name": "severity_source", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "headline": { - "name": "headline", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "metric": { - "name": "metric", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "level": { - "name": "level", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "aggregation": { - "name": "aggregation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "subject": { - "name": "subject", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "attributes": { - "name": "attributes", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "schedule": { - "name": "schedule", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_forecast": { - "name": "is_forecast", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "related_ids": { - "name": "related_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "origin": { - "name": "origin", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "data_updated_at": { - "name": "data_updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "is_stale": { - "name": "is_stale", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "stale_after": { - "name": "stale_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_conditions_obs_geom": { - "name": "idx_conditions_obs_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_conditions_obs_domain": { - "name": "idx_conditions_obs_domain", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_dom_type": { - "name": "idx_conditions_obs_dom_type", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_severity": { - "name": "idx_conditions_obs_severity", - "columns": [ - { - "expression": "severity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_metric": { - "name": "idx_conditions_obs_metric", - "columns": [ - { - "expression": "metric", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_valid_to": { - "name": "idx_conditions_obs_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_expires": { - "name": "idx_conditions_obs_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_subject": { - "name": "idx_conditions_obs_subject", - "columns": [ - { - "expression": "subject", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_source": { - "name": "idx_conditions_obs_source", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "sensor_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_sample": { - "name": "sensor_speed_sample", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_sample_key_bucket": { - "name": "idx_sensor_sample_key_bucket", - "columns": [ - { - "expression": "sensor_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_hour", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sensor_sample_observed": { - "name": "idx_sensor_sample_observed", - "columns": [ - { - "expression": "observed_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_sensor_sample_key_observed": { - "name": "uq_sensor_sample_key_observed", - "nullsNotDistinct": false, - "columns": [ - "sensor_key", - "observed_at" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0004_snapshot.json b/packages/core/drizzle/meta/0004_snapshot.json deleted file mode 100644 index 97f589350..000000000 --- a/packages/core/drizzle/meta/0004_snapshot.json +++ /dev/null @@ -1,959 +0,0 @@ -{ - "id": "f10fc4e9-7e38-499c-9155-f7f88f5babd0", - "prevId": "44062121-31d5-433f-935d-0279ed050e3f", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.observations": { - "name": "observations", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_format": { - "name": "source_format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity_source": { - "name": "severity_source", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "headline": { - "name": "headline", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "metric": { - "name": "metric", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "level": { - "name": "level", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "aggregation": { - "name": "aggregation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "subject": { - "name": "subject", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "attributes": { - "name": "attributes", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "schedule": { - "name": "schedule", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_forecast": { - "name": "is_forecast", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "related_ids": { - "name": "related_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "origin": { - "name": "origin", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "data_updated_at": { - "name": "data_updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "is_stale": { - "name": "is_stale", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "stale_after": { - "name": "stale_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_conditions_obs_geom": { - "name": "idx_conditions_obs_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_conditions_obs_domain": { - "name": "idx_conditions_obs_domain", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_dom_type": { - "name": "idx_conditions_obs_dom_type", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_severity": { - "name": "idx_conditions_obs_severity", - "columns": [ - { - "expression": "severity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_metric": { - "name": "idx_conditions_obs_metric", - "columns": [ - { - "expression": "metric", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_valid_to": { - "name": "idx_conditions_obs_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_expires": { - "name": "idx_conditions_obs_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_subject": { - "name": "idx_conditions_obs_subject", - "columns": [ - { - "expression": "subject", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_source": { - "name": "idx_conditions_obs_source", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "sensor_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_sample": { - "name": "sensor_speed_sample", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_sample_key_bucket": { - "name": "idx_sensor_sample_key_bucket", - "columns": [ - { - "expression": "sensor_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_hour", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sensor_sample_observed": { - "name": "idx_sensor_sample_observed", - "columns": [ - { - "expression": "observed_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_sensor_sample_key_observed": { - "name": "uq_sensor_sample_key_observed", - "nullsNotDistinct": false, - "columns": [ - "sensor_key", - "observed_at" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0005_snapshot.json b/packages/core/drizzle/meta/0005_snapshot.json deleted file mode 100644 index b9ad32079..000000000 --- a/packages/core/drizzle/meta/0005_snapshot.json +++ /dev/null @@ -1,1158 +0,0 @@ -{ - "id": "52a30178-dbae-4660-b0db-1508f2644a09", - "prevId": "f10fc4e9-7e38-499c-9155-f7f88f5babd0", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.observations": { - "name": "observations", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_format": { - "name": "source_format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity_source": { - "name": "severity_source", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "headline": { - "name": "headline", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "metric": { - "name": "metric", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "level": { - "name": "level", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "aggregation": { - "name": "aggregation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "subject": { - "name": "subject", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "attributes": { - "name": "attributes", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "schedule": { - "name": "schedule", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_forecast": { - "name": "is_forecast", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "related_ids": { - "name": "related_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "origin": { - "name": "origin", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "data_updated_at": { - "name": "data_updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "is_stale": { - "name": "is_stale", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "stale_after": { - "name": "stale_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_conditions_obs_geom": { - "name": "idx_conditions_obs_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_conditions_obs_domain": { - "name": "idx_conditions_obs_domain", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_dom_type": { - "name": "idx_conditions_obs_dom_type", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_severity": { - "name": "idx_conditions_obs_severity", - "columns": [ - { - "expression": "severity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_metric": { - "name": "idx_conditions_obs_metric", - "columns": [ - { - "expression": "metric", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_valid_to": { - "name": "idx_conditions_obs_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_expires": { - "name": "idx_conditions_obs_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_subject": { - "name": "idx_conditions_obs_subject", - "columns": [ - { - "expression": "subject", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_source": { - "name": "idx_conditions_obs_source", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "sensor_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_sample": { - "name": "sensor_speed_sample", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_sample_key_bucket": { - "name": "idx_sensor_sample_key_bucket", - "columns": [ - { - "expression": "sensor_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_hour", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sensor_sample_observed": { - "name": "idx_sensor_sample_observed", - "columns": [ - { - "expression": "observed_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_sensor_sample_key_observed": { - "name": "uq_sensor_sample_key_observed", - "nullsNotDistinct": false, - "columns": [ - "sensor_key", - "observed_at" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0006_snapshot.json b/packages/core/drizzle/meta/0006_snapshot.json deleted file mode 100644 index 41641ffe5..000000000 --- a/packages/core/drizzle/meta/0006_snapshot.json +++ /dev/null @@ -1,1232 +0,0 @@ -{ - "id": "46e5a044-498d-44eb-9c0c-78cfaf100a26", - "prevId": "52a30178-dbae-4660-b0db-1508f2644a09", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.observations": { - "name": "observations", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_format": { - "name": "source_format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity_source": { - "name": "severity_source", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "headline": { - "name": "headline", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "metric": { - "name": "metric", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "level": { - "name": "level", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "aggregation": { - "name": "aggregation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "subject": { - "name": "subject", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "attributes": { - "name": "attributes", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "schedule": { - "name": "schedule", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_forecast": { - "name": "is_forecast", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "related_ids": { - "name": "related_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "origin": { - "name": "origin", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "data_updated_at": { - "name": "data_updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "is_stale": { - "name": "is_stale", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "stale_after": { - "name": "stale_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_conditions_obs_geom": { - "name": "idx_conditions_obs_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_conditions_obs_domain": { - "name": "idx_conditions_obs_domain", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_dom_type": { - "name": "idx_conditions_obs_dom_type", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_severity": { - "name": "idx_conditions_obs_severity", - "columns": [ - { - "expression": "severity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_metric": { - "name": "idx_conditions_obs_metric", - "columns": [ - { - "expression": "metric", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_valid_to": { - "name": "idx_conditions_obs_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_expires": { - "name": "idx_conditions_obs_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_subject": { - "name": "idx_conditions_obs_subject", - "columns": [ - { - "expression": "subject", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_source": { - "name": "idx_conditions_obs_source", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "sensor_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_sample": { - "name": "sensor_speed_sample", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_sample_key_bucket": { - "name": "idx_sensor_sample_key_bucket", - "columns": [ - { - "expression": "sensor_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_hour", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sensor_sample_observed": { - "name": "idx_sensor_sample_observed", - "columns": [ - { - "expression": "observed_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_sensor_sample_key_observed": { - "name": "uq_sensor_sample_key_observed", - "nullsNotDistinct": false, - "columns": [ - "sensor_key", - "observed_at" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0007_snapshot.json b/packages/core/drizzle/meta/0007_snapshot.json deleted file mode 100644 index 243f38e77..000000000 --- a/packages/core/drizzle/meta/0007_snapshot.json +++ /dev/null @@ -1,1413 +0,0 @@ -{ - "id": "31c2a009-06c4-4544-90be-6fea5c090542", - "prevId": "46e5a044-498d-44eb-9c0c-78cfaf100a26", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.observations": { - "name": "observations", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_format": { - "name": "source_format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity_source": { - "name": "severity_source", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "headline": { - "name": "headline", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "metric": { - "name": "metric", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "level": { - "name": "level", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "aggregation": { - "name": "aggregation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "subject": { - "name": "subject", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "attributes": { - "name": "attributes", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "schedule": { - "name": "schedule", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_forecast": { - "name": "is_forecast", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "related_ids": { - "name": "related_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "origin": { - "name": "origin", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "data_updated_at": { - "name": "data_updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "is_stale": { - "name": "is_stale", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "stale_after": { - "name": "stale_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "phenomenon_fingerprint": { - "name": "phenomenon_fingerprint", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "replaces": { - "name": "replaces", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "fuzziness": { - "name": "fuzziness", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'exact'" - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'unknown'" - }, - "k_anonymity": { - "name": "k_anonymity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "dp_epsilon": { - "name": "dp_epsilon", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "dp_delta": { - "name": "dp_delta", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "informed": { - "name": "informed", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "source_uri": { - "name": "source_uri", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_license": { - "name": "source_license", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_conditions_obs_geom": { - "name": "idx_conditions_obs_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_conditions_obs_domain": { - "name": "idx_conditions_obs_domain", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_dom_type": { - "name": "idx_conditions_obs_dom_type", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_severity": { - "name": "idx_conditions_obs_severity", - "columns": [ - { - "expression": "severity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_metric": { - "name": "idx_conditions_obs_metric", - "columns": [ - { - "expression": "metric", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_valid_to": { - "name": "idx_conditions_obs_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_expires": { - "name": "idx_conditions_obs_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_subject": { - "name": "idx_conditions_obs_subject", - "columns": [ - { - "expression": "subject", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_source": { - "name": "idx_conditions_obs_source", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_canonical": { - "name": "idx_conditions_obs_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_phenomenon": { - "name": "idx_conditions_obs_phenomenon", - "columns": [ - { - "expression": "phenomenon_fingerprint", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_instance": { - "name": "idx_conditions_obs_instance", - "columns": [ - { - "expression": "instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_privacy": { - "name": "idx_conditions_obs_privacy", - "columns": [ - { - "expression": "privacy_class", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "obs_confidence_score_range": { - "name": "obs_confidence_score_range", - "value": "\"conditions\".\"observations\".\"confidence_score\" IS NULL OR (\"conditions\".\"observations\".\"confidence_score\" >= 0 AND \"conditions\".\"observations\".\"confidence_score\" <= 1)" - }, - "obs_dp_epsilon_nonneg": { - "name": "obs_dp_epsilon_nonneg", - "value": "\"conditions\".\"observations\".\"dp_epsilon\" IS NULL OR \"conditions\".\"observations\".\"dp_epsilon\" >= 0" - }, - "obs_dp_delta_range": { - "name": "obs_dp_delta_range", - "value": "\"conditions\".\"observations\".\"dp_delta\" IS NULL OR (\"conditions\".\"observations\".\"dp_delta\" >= 0 AND \"conditions\".\"observations\".\"dp_delta\" < 1)" - }, - "obs_k_anonymity_positive": { - "name": "obs_k_anonymity_positive", - "value": "\"conditions\".\"observations\".\"k_anonymity\" IS NULL OR \"conditions\".\"observations\".\"k_anonymity\" > 0" - }, - "obs_severity_level_range": { - "name": "obs_severity_level_range", - "value": "\"conditions\".\"observations\".\"severity_level\" IS NULL OR (\"conditions\".\"observations\".\"severity_level\" >= 1 AND \"conditions\".\"observations\".\"severity_level\" <= 5)" - }, - "obs_fuzziness_enum": { - "name": "obs_fuzziness_enum", - "value": "\"conditions\".\"observations\".\"fuzziness\" IN ('exact','low_res','medium_res','end_unknown','start_unknown','extent_unknown')" - }, - "obs_privacy_class_enum": { - "name": "obs_privacy_class_enum", - "value": "\"conditions\".\"observations\".\"privacy_class\" IN ('unknown','authoritative','aggregate','k_anon','dp_noised','crowd_pseudonym')" - } - }, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "sensor_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_sample": { - "name": "sensor_speed_sample", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_sample_key_bucket": { - "name": "idx_sensor_sample_key_bucket", - "columns": [ - { - "expression": "sensor_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_hour", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sensor_sample_observed": { - "name": "idx_sensor_sample_observed", - "columns": [ - { - "expression": "observed_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_sensor_sample_key_observed": { - "name": "uq_sensor_sample_key_observed", - "nullsNotDistinct": false, - "columns": [ - "sensor_key", - "observed_at" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0008_snapshot.json b/packages/core/drizzle/meta/0008_snapshot.json deleted file mode 100644 index 4fada8bad..000000000 --- a/packages/core/drizzle/meta/0008_snapshot.json +++ /dev/null @@ -1,1842 +0,0 @@ -{ - "id": "3a7c57ef-37dd-499e-afc2-c6b4a491d4db", - "prevId": "31c2a009-06c4-4544-90be-6fea5c090542", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observations": { - "name": "observations", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_format": { - "name": "source_format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity_source": { - "name": "severity_source", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "headline": { - "name": "headline", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "metric": { - "name": "metric", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "level": { - "name": "level", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "aggregation": { - "name": "aggregation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "subject": { - "name": "subject", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "attributes": { - "name": "attributes", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "schedule": { - "name": "schedule", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_forecast": { - "name": "is_forecast", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "related_ids": { - "name": "related_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "origin": { - "name": "origin", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "data_updated_at": { - "name": "data_updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "is_stale": { - "name": "is_stale", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "stale_after": { - "name": "stale_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "phenomenon_fingerprint": { - "name": "phenomenon_fingerprint", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "replaces": { - "name": "replaces", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "fuzziness": { - "name": "fuzziness", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'exact'" - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'unknown'" - }, - "k_anonymity": { - "name": "k_anonymity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "dp_epsilon": { - "name": "dp_epsilon", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "dp_delta": { - "name": "dp_delta", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "informed": { - "name": "informed", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "source_uri": { - "name": "source_uri", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_license": { - "name": "source_license", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_conditions_obs_geom": { - "name": "idx_conditions_obs_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_conditions_obs_domain": { - "name": "idx_conditions_obs_domain", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_dom_type": { - "name": "idx_conditions_obs_dom_type", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_severity": { - "name": "idx_conditions_obs_severity", - "columns": [ - { - "expression": "severity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_metric": { - "name": "idx_conditions_obs_metric", - "columns": [ - { - "expression": "metric", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_valid_to": { - "name": "idx_conditions_obs_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_expires": { - "name": "idx_conditions_obs_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_subject": { - "name": "idx_conditions_obs_subject", - "columns": [ - { - "expression": "subject", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_source": { - "name": "idx_conditions_obs_source", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_canonical": { - "name": "idx_conditions_obs_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_phenomenon": { - "name": "idx_conditions_obs_phenomenon", - "columns": [ - { - "expression": "phenomenon_fingerprint", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_instance": { - "name": "idx_conditions_obs_instance", - "columns": [ - { - "expression": "instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_privacy": { - "name": "idx_conditions_obs_privacy", - "columns": [ - { - "expression": "privacy_class", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_evidence_state": { - "name": "idx_conditions_obs_evidence_state", - "columns": [ - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "obs_confidence_score_range": { - "name": "obs_confidence_score_range", - "value": "\"conditions\".\"observations\".\"confidence_score\" IS NULL OR (\"conditions\".\"observations\".\"confidence_score\" >= 0 AND \"conditions\".\"observations\".\"confidence_score\" <= 1)" - }, - "obs_dp_epsilon_nonneg": { - "name": "obs_dp_epsilon_nonneg", - "value": "\"conditions\".\"observations\".\"dp_epsilon\" IS NULL OR \"conditions\".\"observations\".\"dp_epsilon\" >= 0" - }, - "obs_dp_delta_range": { - "name": "obs_dp_delta_range", - "value": "\"conditions\".\"observations\".\"dp_delta\" IS NULL OR (\"conditions\".\"observations\".\"dp_delta\" >= 0 AND \"conditions\".\"observations\".\"dp_delta\" < 1)" - }, - "obs_k_anonymity_positive": { - "name": "obs_k_anonymity_positive", - "value": "\"conditions\".\"observations\".\"k_anonymity\" IS NULL OR \"conditions\".\"observations\".\"k_anonymity\" > 0" - }, - "obs_severity_level_range": { - "name": "obs_severity_level_range", - "value": "\"conditions\".\"observations\".\"severity_level\" IS NULL OR (\"conditions\".\"observations\".\"severity_level\" >= 1 AND \"conditions\".\"observations\".\"severity_level\" <= 5)" - }, - "obs_fuzziness_enum": { - "name": "obs_fuzziness_enum", - "value": "\"conditions\".\"observations\".\"fuzziness\" IN ('exact','low_res','medium_res','end_unknown','start_unknown','extent_unknown')" - }, - "obs_privacy_class_enum": { - "name": "obs_privacy_class_enum", - "value": "\"conditions\".\"observations\".\"privacy_class\" IN ('unknown','authoritative','aggregate','k_anon','dp_noised','crowd_pseudonym')" - }, - "obs_evidence_state_enum": { - "name": "obs_evidence_state_enum", - "value": "\"conditions\".\"observations\".\"evidence_state\" IS NULL OR \"conditions\".\"observations\".\"evidence_state\" IN ('self_reported','corroborated','externally_resolved','negated','expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_observation": { - "name": "idx_report_evidence_observation", - "columns": [ - { - "expression": "observation_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"conditions\".\"report_evidence\".\"evidence_kind\" IN ('report','confirm','negate','official_match','reviewer_accept','reviewer_reject','expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "sensor_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_sample": { - "name": "sensor_speed_sample", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_sample_key_bucket": { - "name": "idx_sensor_sample_key_bucket", - "columns": [ - { - "expression": "sensor_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_hour", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sensor_sample_observed": { - "name": "idx_sensor_sample_observed", - "columns": [ - { - "expression": "observed_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_sensor_sample_key_observed": { - "name": "uq_sensor_sample_key_observed", - "nullsNotDistinct": false, - "columns": [ - "sensor_key", - "observed_at" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_subject": { - "name": "idx_sub_claim_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"conditions\".\"sub_claim\".\"claim_type\" IN ('confirm','negate','flag')" - } - }, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0009_snapshot.json b/packages/core/drizzle/meta/0009_snapshot.json deleted file mode 100644 index 61726a2b6..000000000 --- a/packages/core/drizzle/meta/0009_snapshot.json +++ /dev/null @@ -1,1889 +0,0 @@ -{ - "id": "e369c20f-1237-4275-a674-c470d316eb14", - "prevId": "3a7c57ef-37dd-499e-afc2-c6b4a491d4db", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observations": { - "name": "observations", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_format": { - "name": "source_format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity_source": { - "name": "severity_source", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "headline": { - "name": "headline", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "metric": { - "name": "metric", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "level": { - "name": "level", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "aggregation": { - "name": "aggregation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "subject": { - "name": "subject", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "attributes": { - "name": "attributes", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "schedule": { - "name": "schedule", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_forecast": { - "name": "is_forecast", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "related_ids": { - "name": "related_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "origin": { - "name": "origin", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "data_updated_at": { - "name": "data_updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "is_stale": { - "name": "is_stale", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "stale_after": { - "name": "stale_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "phenomenon_fingerprint": { - "name": "phenomenon_fingerprint", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "replaces": { - "name": "replaces", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "fuzziness": { - "name": "fuzziness", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'exact'" - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'unknown'" - }, - "k_anonymity": { - "name": "k_anonymity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "dp_epsilon": { - "name": "dp_epsilon", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "dp_delta": { - "name": "dp_delta", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "informed": { - "name": "informed", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "source_uri": { - "name": "source_uri", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_license": { - "name": "source_license", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_conditions_obs_geom": { - "name": "idx_conditions_obs_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_conditions_obs_domain": { - "name": "idx_conditions_obs_domain", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_dom_type": { - "name": "idx_conditions_obs_dom_type", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_severity": { - "name": "idx_conditions_obs_severity", - "columns": [ - { - "expression": "severity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_metric": { - "name": "idx_conditions_obs_metric", - "columns": [ - { - "expression": "metric", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_valid_to": { - "name": "idx_conditions_obs_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_expires": { - "name": "idx_conditions_obs_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_subject": { - "name": "idx_conditions_obs_subject", - "columns": [ - { - "expression": "subject", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_source": { - "name": "idx_conditions_obs_source", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_canonical": { - "name": "idx_conditions_obs_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_phenomenon": { - "name": "idx_conditions_obs_phenomenon", - "columns": [ - { - "expression": "phenomenon_fingerprint", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_instance": { - "name": "idx_conditions_obs_instance", - "columns": [ - { - "expression": "instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_privacy": { - "name": "idx_conditions_obs_privacy", - "columns": [ - { - "expression": "privacy_class", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_evidence_state": { - "name": "idx_conditions_obs_evidence_state", - "columns": [ - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "obs_confidence_score_range": { - "name": "obs_confidence_score_range", - "value": "\"conditions\".\"observations\".\"confidence_score\" IS NULL OR (\"conditions\".\"observations\".\"confidence_score\" >= 0 AND \"conditions\".\"observations\".\"confidence_score\" <= 1)" - }, - "obs_dp_epsilon_nonneg": { - "name": "obs_dp_epsilon_nonneg", - "value": "\"conditions\".\"observations\".\"dp_epsilon\" IS NULL OR \"conditions\".\"observations\".\"dp_epsilon\" >= 0" - }, - "obs_dp_delta_range": { - "name": "obs_dp_delta_range", - "value": "\"conditions\".\"observations\".\"dp_delta\" IS NULL OR (\"conditions\".\"observations\".\"dp_delta\" >= 0 AND \"conditions\".\"observations\".\"dp_delta\" < 1)" - }, - "obs_k_anonymity_positive": { - "name": "obs_k_anonymity_positive", - "value": "\"conditions\".\"observations\".\"k_anonymity\" IS NULL OR \"conditions\".\"observations\".\"k_anonymity\" > 0" - }, - "obs_severity_level_range": { - "name": "obs_severity_level_range", - "value": "\"conditions\".\"observations\".\"severity_level\" IS NULL OR (\"conditions\".\"observations\".\"severity_level\" >= 1 AND \"conditions\".\"observations\".\"severity_level\" <= 5)" - }, - "obs_fuzziness_enum": { - "name": "obs_fuzziness_enum", - "value": "\"conditions\".\"observations\".\"fuzziness\" IN ('exact','low_res','medium_res','end_unknown','start_unknown','extent_unknown')" - }, - "obs_privacy_class_enum": { - "name": "obs_privacy_class_enum", - "value": "\"conditions\".\"observations\".\"privacy_class\" IN ('unknown','authoritative','aggregate','k_anon','dp_noised','crowd_pseudonym')" - }, - "obs_evidence_state_enum": { - "name": "obs_evidence_state_enum", - "value": "\"conditions\".\"observations\".\"evidence_state\" IS NULL OR \"conditions\".\"observations\".\"evidence_state\" IN ('self_reported','corroborated','externally_resolved','negated','expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_observation": { - "name": "idx_report_evidence_observation", - "columns": [ - { - "expression": "observation_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"conditions\".\"report_evidence\".\"evidence_kind\" IN ('report','confirm','negate','official_match','reviewer_accept','reviewer_reject','expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "sensor_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_sample": { - "name": "sensor_speed_sample", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_sample_key_bucket": { - "name": "idx_sensor_sample_key_bucket", - "columns": [ - { - "expression": "sensor_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_hour", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sensor_sample_observed": { - "name": "idx_sensor_sample_observed", - "columns": [ - { - "expression": "observed_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_sensor_sample_key_observed": { - "name": "uq_sensor_sample_key_observed", - "nullsNotDistinct": false, - "columns": [ - "sensor_key", - "observed_at" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_subject": { - "name": "idx_sub_claim_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"conditions\".\"sub_claim\".\"claim_type\" IN ('confirm','negate','flag')" - } - }, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0010_snapshot.json b/packages/core/drizzle/meta/0010_snapshot.json deleted file mode 100644 index 2d285739b..000000000 --- a/packages/core/drizzle/meta/0010_snapshot.json +++ /dev/null @@ -1,1911 +0,0 @@ -{ - "id": "fbab88d9-03ea-445b-96ae-c19dc682c270", - "prevId": "e369c20f-1237-4275-a674-c470d316eb14", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observations": { - "name": "observations", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_format": { - "name": "source_format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity_source": { - "name": "severity_source", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "headline": { - "name": "headline", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "metric": { - "name": "metric", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "level": { - "name": "level", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "aggregation": { - "name": "aggregation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "subject": { - "name": "subject", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "attributes": { - "name": "attributes", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "schedule": { - "name": "schedule", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_forecast": { - "name": "is_forecast", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "related_ids": { - "name": "related_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "origin": { - "name": "origin", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "data_updated_at": { - "name": "data_updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "is_stale": { - "name": "is_stale", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "stale_after": { - "name": "stale_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "phenomenon_fingerprint": { - "name": "phenomenon_fingerprint", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "replaces": { - "name": "replaces", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "fuzziness": { - "name": "fuzziness", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'exact'" - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'unknown'" - }, - "k_anonymity": { - "name": "k_anonymity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "dp_epsilon": { - "name": "dp_epsilon", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "dp_delta": { - "name": "dp_delta", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "informed": { - "name": "informed", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "source_uri": { - "name": "source_uri", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_license": { - "name": "source_license", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_conditions_obs_geom": { - "name": "idx_conditions_obs_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_conditions_obs_domain": { - "name": "idx_conditions_obs_domain", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_dom_type": { - "name": "idx_conditions_obs_dom_type", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_severity": { - "name": "idx_conditions_obs_severity", - "columns": [ - { - "expression": "severity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_metric": { - "name": "idx_conditions_obs_metric", - "columns": [ - { - "expression": "metric", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_valid_to": { - "name": "idx_conditions_obs_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_expires": { - "name": "idx_conditions_obs_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_subject": { - "name": "idx_conditions_obs_subject", - "columns": [ - { - "expression": "subject", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_source": { - "name": "idx_conditions_obs_source", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_canonical": { - "name": "idx_conditions_obs_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_phenomenon": { - "name": "idx_conditions_obs_phenomenon", - "columns": [ - { - "expression": "phenomenon_fingerprint", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_instance": { - "name": "idx_conditions_obs_instance", - "columns": [ - { - "expression": "instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_privacy": { - "name": "idx_conditions_obs_privacy", - "columns": [ - { - "expression": "privacy_class", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_evidence_state": { - "name": "idx_conditions_obs_evidence_state", - "columns": [ - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_flagged": { - "name": "idx_conditions_obs_flagged", - "columns": [ - { - "expression": "flagged_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observations\".\"flagged_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "obs_confidence_score_range": { - "name": "obs_confidence_score_range", - "value": "\"conditions\".\"observations\".\"confidence_score\" IS NULL OR (\"conditions\".\"observations\".\"confidence_score\" >= 0 AND \"conditions\".\"observations\".\"confidence_score\" <= 1)" - }, - "obs_dp_epsilon_nonneg": { - "name": "obs_dp_epsilon_nonneg", - "value": "\"conditions\".\"observations\".\"dp_epsilon\" IS NULL OR \"conditions\".\"observations\".\"dp_epsilon\" >= 0" - }, - "obs_dp_delta_range": { - "name": "obs_dp_delta_range", - "value": "\"conditions\".\"observations\".\"dp_delta\" IS NULL OR (\"conditions\".\"observations\".\"dp_delta\" >= 0 AND \"conditions\".\"observations\".\"dp_delta\" < 1)" - }, - "obs_k_anonymity_positive": { - "name": "obs_k_anonymity_positive", - "value": "\"conditions\".\"observations\".\"k_anonymity\" IS NULL OR \"conditions\".\"observations\".\"k_anonymity\" > 0" - }, - "obs_severity_level_range": { - "name": "obs_severity_level_range", - "value": "\"conditions\".\"observations\".\"severity_level\" IS NULL OR (\"conditions\".\"observations\".\"severity_level\" >= 1 AND \"conditions\".\"observations\".\"severity_level\" <= 5)" - }, - "obs_fuzziness_enum": { - "name": "obs_fuzziness_enum", - "value": "\"conditions\".\"observations\".\"fuzziness\" IN ('exact','low_res','medium_res','end_unknown','start_unknown','extent_unknown')" - }, - "obs_privacy_class_enum": { - "name": "obs_privacy_class_enum", - "value": "\"conditions\".\"observations\".\"privacy_class\" IN ('unknown','authoritative','aggregate','k_anon','dp_noised','crowd_pseudonym')" - }, - "obs_evidence_state_enum": { - "name": "obs_evidence_state_enum", - "value": "\"conditions\".\"observations\".\"evidence_state\" IS NULL OR \"conditions\".\"observations\".\"evidence_state\" IN ('self_reported','corroborated','externally_resolved','negated','expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_observation": { - "name": "idx_report_evidence_observation", - "columns": [ - { - "expression": "observation_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"conditions\".\"report_evidence\".\"evidence_kind\" IN ('report','confirm','negate','official_match','reviewer_accept','reviewer_reject','expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "sensor_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_sample": { - "name": "sensor_speed_sample", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_sample_key_bucket": { - "name": "idx_sensor_sample_key_bucket", - "columns": [ - { - "expression": "sensor_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_hour", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sensor_sample_observed": { - "name": "idx_sensor_sample_observed", - "columns": [ - { - "expression": "observed_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_sensor_sample_key_observed": { - "name": "uq_sensor_sample_key_observed", - "nullsNotDistinct": false, - "columns": [ - "sensor_key", - "observed_at" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_subject": { - "name": "idx_sub_claim_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"conditions\".\"sub_claim\".\"claim_type\" IN ('confirm','negate','flag')" - } - }, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0011_snapshot.json b/packages/core/drizzle/meta/0011_snapshot.json deleted file mode 100644 index a6b433500..000000000 --- a/packages/core/drizzle/meta/0011_snapshot.json +++ /dev/null @@ -1,1932 +0,0 @@ -{ - "id": "7d447d7a-00bd-433f-8d27-23a5a98888a0", - "prevId": "fbab88d9-03ea-445b-96ae-c19dc682c270", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observations": { - "name": "observations", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_format": { - "name": "source_format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity_source": { - "name": "severity_source", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "headline": { - "name": "headline", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "metric": { - "name": "metric", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "level": { - "name": "level", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "aggregation": { - "name": "aggregation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "subject": { - "name": "subject", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "attributes": { - "name": "attributes", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "schedule": { - "name": "schedule", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_forecast": { - "name": "is_forecast", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "related_ids": { - "name": "related_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "origin": { - "name": "origin", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "data_updated_at": { - "name": "data_updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "is_stale": { - "name": "is_stale", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "stale_after": { - "name": "stale_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "phenomenon_fingerprint": { - "name": "phenomenon_fingerprint", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "replaces": { - "name": "replaces", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "fuzziness": { - "name": "fuzziness", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'exact'" - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'unknown'" - }, - "k_anonymity": { - "name": "k_anonymity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "dp_epsilon": { - "name": "dp_epsilon", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "dp_delta": { - "name": "dp_delta", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "informed": { - "name": "informed", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "source_uri": { - "name": "source_uri", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_license": { - "name": "source_license", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_conditions_obs_geom": { - "name": "idx_conditions_obs_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_conditions_obs_domain": { - "name": "idx_conditions_obs_domain", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_dom_type": { - "name": "idx_conditions_obs_dom_type", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_severity": { - "name": "idx_conditions_obs_severity", - "columns": [ - { - "expression": "severity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_metric": { - "name": "idx_conditions_obs_metric", - "columns": [ - { - "expression": "metric", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_valid_to": { - "name": "idx_conditions_obs_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_expires": { - "name": "idx_conditions_obs_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_subject": { - "name": "idx_conditions_obs_subject", - "columns": [ - { - "expression": "subject", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_source": { - "name": "idx_conditions_obs_source", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_canonical": { - "name": "idx_conditions_obs_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_phenomenon": { - "name": "idx_conditions_obs_phenomenon", - "columns": [ - { - "expression": "phenomenon_fingerprint", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_instance": { - "name": "idx_conditions_obs_instance", - "columns": [ - { - "expression": "instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_privacy": { - "name": "idx_conditions_obs_privacy", - "columns": [ - { - "expression": "privacy_class", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_evidence_state": { - "name": "idx_conditions_obs_evidence_state", - "columns": [ - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_flagged": { - "name": "idx_conditions_obs_flagged", - "columns": [ - { - "expression": "flagged_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observations\".\"flagged_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "obs_confidence_score_range": { - "name": "obs_confidence_score_range", - "value": "\"conditions\".\"observations\".\"confidence_score\" IS NULL OR (\"conditions\".\"observations\".\"confidence_score\" >= 0 AND \"conditions\".\"observations\".\"confidence_score\" <= 1)" - }, - "obs_dp_epsilon_nonneg": { - "name": "obs_dp_epsilon_nonneg", - "value": "\"conditions\".\"observations\".\"dp_epsilon\" IS NULL OR \"conditions\".\"observations\".\"dp_epsilon\" >= 0" - }, - "obs_dp_delta_range": { - "name": "obs_dp_delta_range", - "value": "\"conditions\".\"observations\".\"dp_delta\" IS NULL OR (\"conditions\".\"observations\".\"dp_delta\" >= 0 AND \"conditions\".\"observations\".\"dp_delta\" < 1)" - }, - "obs_k_anonymity_positive": { - "name": "obs_k_anonymity_positive", - "value": "\"conditions\".\"observations\".\"k_anonymity\" IS NULL OR \"conditions\".\"observations\".\"k_anonymity\" > 0" - }, - "obs_severity_level_range": { - "name": "obs_severity_level_range", - "value": "\"conditions\".\"observations\".\"severity_level\" IS NULL OR (\"conditions\".\"observations\".\"severity_level\" >= 1 AND \"conditions\".\"observations\".\"severity_level\" <= 5)" - }, - "obs_fuzziness_enum": { - "name": "obs_fuzziness_enum", - "value": "\"conditions\".\"observations\".\"fuzziness\" IN ('exact','low_res','medium_res','end_unknown','start_unknown','extent_unknown')" - }, - "obs_privacy_class_enum": { - "name": "obs_privacy_class_enum", - "value": "\"conditions\".\"observations\".\"privacy_class\" IN ('unknown','authoritative','aggregate','k_anon','dp_noised','crowd_pseudonym')" - }, - "obs_evidence_state_enum": { - "name": "obs_evidence_state_enum", - "value": "\"conditions\".\"observations\".\"evidence_state\" IS NULL OR \"conditions\".\"observations\".\"evidence_state\" IN ('self_reported','corroborated','externally_resolved','negated','expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_observation": { - "name": "idx_report_evidence_observation", - "columns": [ - { - "expression": "observation_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"conditions\".\"report_evidence\".\"evidence_kind\" IN ('report','confirm','negate','official_match','reviewer_accept','reviewer_reject','expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "sensor_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_sample": { - "name": "sensor_speed_sample", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_sample_key_bucket": { - "name": "idx_sensor_sample_key_bucket", - "columns": [ - { - "expression": "sensor_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_hour", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sensor_sample_observed": { - "name": "idx_sensor_sample_observed", - "columns": [ - { - "expression": "observed_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_sensor_sample_key_observed": { - "name": "uq_sensor_sample_key_observed", - "nullsNotDistinct": false, - "columns": [ - "sensor_key", - "observed_at" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_subject": { - "name": "idx_sub_claim_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"conditions\".\"sub_claim\".\"claim_type\" IN ('confirm','negate','flag')" - } - }, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0012_snapshot.json b/packages/core/drizzle/meta/0012_snapshot.json deleted file mode 100644 index 751312c00..000000000 --- a/packages/core/drizzle/meta/0012_snapshot.json +++ /dev/null @@ -1,1969 +0,0 @@ -{ - "id": "a075bc05-4105-4101-a38e-83ba0855f3f3", - "prevId": "7d447d7a-00bd-433f-8d27-23a5a98888a0", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observations": { - "name": "observations", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_format": { - "name": "source_format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity_source": { - "name": "severity_source", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "headline": { - "name": "headline", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "metric": { - "name": "metric", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "level": { - "name": "level", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "aggregation": { - "name": "aggregation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "subject": { - "name": "subject", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "attributes": { - "name": "attributes", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "schedule": { - "name": "schedule", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_forecast": { - "name": "is_forecast", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "related_ids": { - "name": "related_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "origin": { - "name": "origin", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "data_updated_at": { - "name": "data_updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "is_stale": { - "name": "is_stale", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "stale_after": { - "name": "stale_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "phenomenon_fingerprint": { - "name": "phenomenon_fingerprint", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "replaces": { - "name": "replaces", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "fuzziness": { - "name": "fuzziness", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'exact'" - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'unknown'" - }, - "k_anonymity": { - "name": "k_anonymity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "dp_epsilon": { - "name": "dp_epsilon", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "dp_delta": { - "name": "dp_delta", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "informed": { - "name": "informed", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "source_uri": { - "name": "source_uri", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_license": { - "name": "source_license", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_conditions_obs_geom": { - "name": "idx_conditions_obs_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_conditions_obs_domain": { - "name": "idx_conditions_obs_domain", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_dom_type": { - "name": "idx_conditions_obs_dom_type", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_severity": { - "name": "idx_conditions_obs_severity", - "columns": [ - { - "expression": "severity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_metric": { - "name": "idx_conditions_obs_metric", - "columns": [ - { - "expression": "metric", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_valid_to": { - "name": "idx_conditions_obs_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_expires": { - "name": "idx_conditions_obs_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_subject": { - "name": "idx_conditions_obs_subject", - "columns": [ - { - "expression": "subject", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_source": { - "name": "idx_conditions_obs_source", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_canonical": { - "name": "idx_conditions_obs_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_phenomenon": { - "name": "idx_conditions_obs_phenomenon", - "columns": [ - { - "expression": "phenomenon_fingerprint", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_instance": { - "name": "idx_conditions_obs_instance", - "columns": [ - { - "expression": "instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_privacy": { - "name": "idx_conditions_obs_privacy", - "columns": [ - { - "expression": "privacy_class", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_evidence_state": { - "name": "idx_conditions_obs_evidence_state", - "columns": [ - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_flagged": { - "name": "idx_conditions_obs_flagged", - "columns": [ - { - "expression": "flagged_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observations\".\"flagged_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "obs_confidence_score_range": { - "name": "obs_confidence_score_range", - "value": "\"conditions\".\"observations\".\"confidence_score\" IS NULL OR (\"conditions\".\"observations\".\"confidence_score\" >= 0 AND \"conditions\".\"observations\".\"confidence_score\" <= 1)" - }, - "obs_dp_epsilon_nonneg": { - "name": "obs_dp_epsilon_nonneg", - "value": "\"conditions\".\"observations\".\"dp_epsilon\" IS NULL OR \"conditions\".\"observations\".\"dp_epsilon\" >= 0" - }, - "obs_dp_delta_range": { - "name": "obs_dp_delta_range", - "value": "\"conditions\".\"observations\".\"dp_delta\" IS NULL OR (\"conditions\".\"observations\".\"dp_delta\" >= 0 AND \"conditions\".\"observations\".\"dp_delta\" < 1)" - }, - "obs_k_anonymity_positive": { - "name": "obs_k_anonymity_positive", - "value": "\"conditions\".\"observations\".\"k_anonymity\" IS NULL OR \"conditions\".\"observations\".\"k_anonymity\" > 0" - }, - "obs_severity_level_range": { - "name": "obs_severity_level_range", - "value": "\"conditions\".\"observations\".\"severity_level\" IS NULL OR (\"conditions\".\"observations\".\"severity_level\" >= 1 AND \"conditions\".\"observations\".\"severity_level\" <= 5)" - }, - "obs_fuzziness_enum": { - "name": "obs_fuzziness_enum", - "value": "\"conditions\".\"observations\".\"fuzziness\" IN ('exact','low_res','medium_res','end_unknown','start_unknown','extent_unknown')" - }, - "obs_privacy_class_enum": { - "name": "obs_privacy_class_enum", - "value": "\"conditions\".\"observations\".\"privacy_class\" IN ('unknown','authoritative','aggregate','k_anon','dp_noised','crowd_pseudonym')" - }, - "obs_evidence_state_enum": { - "name": "obs_evidence_state_enum", - "value": "\"conditions\".\"observations\".\"evidence_state\" IS NULL OR \"conditions\".\"observations\".\"evidence_state\" IN ('self_reported','corroborated','externally_resolved','negated','expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_observation": { - "name": "idx_report_evidence_observation", - "columns": [ - { - "expression": "observation_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"conditions\".\"report_evidence\".\"evidence_kind\" IN ('report','confirm','negate','official_match','reviewer_accept','reviewer_reject','expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "sensor_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_sample": { - "name": "sensor_speed_sample", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_sample_key_bucket": { - "name": "idx_sensor_sample_key_bucket", - "columns": [ - { - "expression": "sensor_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_hour", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sensor_sample_observed": { - "name": "idx_sensor_sample_observed", - "columns": [ - { - "expression": "observed_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_sensor_sample_key_observed": { - "name": "uq_sensor_sample_key_observed", - "nullsNotDistinct": false, - "columns": [ - "sensor_key", - "observed_at" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_subject": { - "name": "idx_sub_claim_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"conditions\".\"sub_claim\".\"claim_type\" IN ('confirm','negate','flag')" - } - }, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0013_snapshot.json b/packages/core/drizzle/meta/0013_snapshot.json deleted file mode 100644 index 79c81957d..000000000 --- a/packages/core/drizzle/meta/0013_snapshot.json +++ /dev/null @@ -1,2024 +0,0 @@ -{ - "id": "ea55da72-8a81-43e8-8de2-302fd14de204", - "prevId": "a075bc05-4105-4101-a38e-83ba0855f3f3", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observations": { - "name": "observations", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_format": { - "name": "source_format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity_source": { - "name": "severity_source", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "headline": { - "name": "headline", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "metric": { - "name": "metric", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "level": { - "name": "level", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "aggregation": { - "name": "aggregation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "subject": { - "name": "subject", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "attributes": { - "name": "attributes", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "schedule": { - "name": "schedule", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_forecast": { - "name": "is_forecast", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "related_ids": { - "name": "related_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "origin": { - "name": "origin", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "data_updated_at": { - "name": "data_updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "is_stale": { - "name": "is_stale", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "stale_after": { - "name": "stale_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "phenomenon_fingerprint": { - "name": "phenomenon_fingerprint", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "replaces": { - "name": "replaces", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "fuzziness": { - "name": "fuzziness", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'exact'" - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'unknown'" - }, - "k_anonymity": { - "name": "k_anonymity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "dp_epsilon": { - "name": "dp_epsilon", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "dp_delta": { - "name": "dp_delta", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "informed": { - "name": "informed", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "source_uri": { - "name": "source_uri", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_license": { - "name": "source_license", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_conditions_obs_geom": { - "name": "idx_conditions_obs_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_conditions_obs_domain": { - "name": "idx_conditions_obs_domain", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_dom_type": { - "name": "idx_conditions_obs_dom_type", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_severity": { - "name": "idx_conditions_obs_severity", - "columns": [ - { - "expression": "severity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_metric": { - "name": "idx_conditions_obs_metric", - "columns": [ - { - "expression": "metric", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_valid_to": { - "name": "idx_conditions_obs_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_expires": { - "name": "idx_conditions_obs_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_subject": { - "name": "idx_conditions_obs_subject", - "columns": [ - { - "expression": "subject", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_source": { - "name": "idx_conditions_obs_source", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_canonical": { - "name": "idx_conditions_obs_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_phenomenon": { - "name": "idx_conditions_obs_phenomenon", - "columns": [ - { - "expression": "phenomenon_fingerprint", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_instance": { - "name": "idx_conditions_obs_instance", - "columns": [ - { - "expression": "instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_privacy": { - "name": "idx_conditions_obs_privacy", - "columns": [ - { - "expression": "privacy_class", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_evidence_state": { - "name": "idx_conditions_obs_evidence_state", - "columns": [ - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_flagged": { - "name": "idx_conditions_obs_flagged", - "columns": [ - { - "expression": "flagged_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observations\".\"flagged_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "obs_confidence_score_range": { - "name": "obs_confidence_score_range", - "value": "\"conditions\".\"observations\".\"confidence_score\" IS NULL OR (\"conditions\".\"observations\".\"confidence_score\" >= 0 AND \"conditions\".\"observations\".\"confidence_score\" <= 1)" - }, - "obs_dp_epsilon_nonneg": { - "name": "obs_dp_epsilon_nonneg", - "value": "\"conditions\".\"observations\".\"dp_epsilon\" IS NULL OR \"conditions\".\"observations\".\"dp_epsilon\" >= 0" - }, - "obs_dp_delta_range": { - "name": "obs_dp_delta_range", - "value": "\"conditions\".\"observations\".\"dp_delta\" IS NULL OR (\"conditions\".\"observations\".\"dp_delta\" >= 0 AND \"conditions\".\"observations\".\"dp_delta\" < 1)" - }, - "obs_k_anonymity_positive": { - "name": "obs_k_anonymity_positive", - "value": "\"conditions\".\"observations\".\"k_anonymity\" IS NULL OR \"conditions\".\"observations\".\"k_anonymity\" > 0" - }, - "obs_severity_level_range": { - "name": "obs_severity_level_range", - "value": "\"conditions\".\"observations\".\"severity_level\" IS NULL OR (\"conditions\".\"observations\".\"severity_level\" >= 1 AND \"conditions\".\"observations\".\"severity_level\" <= 5)" - }, - "obs_fuzziness_enum": { - "name": "obs_fuzziness_enum", - "value": "\"conditions\".\"observations\".\"fuzziness\" IN ('exact','low_res','medium_res','end_unknown','start_unknown','extent_unknown')" - }, - "obs_privacy_class_enum": { - "name": "obs_privacy_class_enum", - "value": "\"conditions\".\"observations\".\"privacy_class\" IN ('unknown','authoritative','aggregate','k_anon','dp_noised','crowd_pseudonym')" - }, - "obs_evidence_state_enum": { - "name": "obs_evidence_state_enum", - "value": "\"conditions\".\"observations\".\"evidence_state\" IS NULL OR \"conditions\".\"observations\".\"evidence_state\" IN ('self_reported','corroborated','externally_resolved','negated','expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_observation": { - "name": "idx_report_evidence_observation", - "columns": [ - { - "expression": "observation_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"conditions\".\"report_evidence\".\"evidence_kind\" IN ('report','confirm','negate','official_match','reviewer_accept','reviewer_reject','expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "sensor_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_sample": { - "name": "sensor_speed_sample", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_sample_key_bucket": { - "name": "idx_sensor_sample_key_bucket", - "columns": [ - { - "expression": "sensor_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_hour", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sensor_sample_observed": { - "name": "idx_sensor_sample_observed", - "columns": [ - { - "expression": "observed_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_sensor_sample_key_observed": { - "name": "uq_sensor_sample_key_observed", - "nullsNotDistinct": false, - "columns": [ - "sensor_key", - "observed_at" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_subject": { - "name": "idx_sub_claim_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"conditions\".\"sub_claim\".\"claim_type\" IN ('confirm','negate','flag')" - } - }, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0014_snapshot.json b/packages/core/drizzle/meta/0014_snapshot.json deleted file mode 100644 index b6979eade..000000000 --- a/packages/core/drizzle/meta/0014_snapshot.json +++ /dev/null @@ -1,2101 +0,0 @@ -{ - "id": "524c99ba-a894-4395-987a-54520aec6b0d", - "prevId": "ea55da72-8a81-43e8-8de2-302fd14de204", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "object_id": { - "name": "object_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_snapshot": { - "name": "payload_snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_federation_outbox_object": { - "name": "idx_federation_outbox_object", - "columns": [ - { - "expression": "object_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - } - }, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observations": { - "name": "observations", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_format": { - "name": "source_format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity_source": { - "name": "severity_source", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "headline": { - "name": "headline", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "metric": { - "name": "metric", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "level": { - "name": "level", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "aggregation": { - "name": "aggregation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "subject": { - "name": "subject", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "attributes": { - "name": "attributes", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "schedule": { - "name": "schedule", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_forecast": { - "name": "is_forecast", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "related_ids": { - "name": "related_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "origin": { - "name": "origin", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "data_updated_at": { - "name": "data_updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "is_stale": { - "name": "is_stale", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "stale_after": { - "name": "stale_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "phenomenon_fingerprint": { - "name": "phenomenon_fingerprint", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "replaces": { - "name": "replaces", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "fuzziness": { - "name": "fuzziness", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'exact'" - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'unknown'" - }, - "k_anonymity": { - "name": "k_anonymity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "dp_epsilon": { - "name": "dp_epsilon", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "dp_delta": { - "name": "dp_delta", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "informed": { - "name": "informed", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "source_uri": { - "name": "source_uri", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_license": { - "name": "source_license", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_conditions_obs_geom": { - "name": "idx_conditions_obs_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_conditions_obs_domain": { - "name": "idx_conditions_obs_domain", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_dom_type": { - "name": "idx_conditions_obs_dom_type", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_severity": { - "name": "idx_conditions_obs_severity", - "columns": [ - { - "expression": "severity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_metric": { - "name": "idx_conditions_obs_metric", - "columns": [ - { - "expression": "metric", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_valid_to": { - "name": "idx_conditions_obs_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_expires": { - "name": "idx_conditions_obs_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_subject": { - "name": "idx_conditions_obs_subject", - "columns": [ - { - "expression": "subject", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_source": { - "name": "idx_conditions_obs_source", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_canonical": { - "name": "idx_conditions_obs_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_phenomenon": { - "name": "idx_conditions_obs_phenomenon", - "columns": [ - { - "expression": "phenomenon_fingerprint", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_instance": { - "name": "idx_conditions_obs_instance", - "columns": [ - { - "expression": "instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_privacy": { - "name": "idx_conditions_obs_privacy", - "columns": [ - { - "expression": "privacy_class", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_evidence_state": { - "name": "idx_conditions_obs_evidence_state", - "columns": [ - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_flagged": { - "name": "idx_conditions_obs_flagged", - "columns": [ - { - "expression": "flagged_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observations\".\"flagged_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "obs_confidence_score_range": { - "name": "obs_confidence_score_range", - "value": "\"conditions\".\"observations\".\"confidence_score\" IS NULL OR (\"conditions\".\"observations\".\"confidence_score\" >= 0 AND \"conditions\".\"observations\".\"confidence_score\" <= 1)" - }, - "obs_dp_epsilon_nonneg": { - "name": "obs_dp_epsilon_nonneg", - "value": "\"conditions\".\"observations\".\"dp_epsilon\" IS NULL OR \"conditions\".\"observations\".\"dp_epsilon\" >= 0" - }, - "obs_dp_delta_range": { - "name": "obs_dp_delta_range", - "value": "\"conditions\".\"observations\".\"dp_delta\" IS NULL OR (\"conditions\".\"observations\".\"dp_delta\" >= 0 AND \"conditions\".\"observations\".\"dp_delta\" < 1)" - }, - "obs_k_anonymity_positive": { - "name": "obs_k_anonymity_positive", - "value": "\"conditions\".\"observations\".\"k_anonymity\" IS NULL OR \"conditions\".\"observations\".\"k_anonymity\" > 0" - }, - "obs_severity_level_range": { - "name": "obs_severity_level_range", - "value": "\"conditions\".\"observations\".\"severity_level\" IS NULL OR (\"conditions\".\"observations\".\"severity_level\" >= 1 AND \"conditions\".\"observations\".\"severity_level\" <= 5)" - }, - "obs_fuzziness_enum": { - "name": "obs_fuzziness_enum", - "value": "\"conditions\".\"observations\".\"fuzziness\" IN ('exact','low_res','medium_res','end_unknown','start_unknown','extent_unknown')" - }, - "obs_privacy_class_enum": { - "name": "obs_privacy_class_enum", - "value": "\"conditions\".\"observations\".\"privacy_class\" IN ('unknown','authoritative','aggregate','k_anon','dp_noised','crowd_pseudonym')" - }, - "obs_evidence_state_enum": { - "name": "obs_evidence_state_enum", - "value": "\"conditions\".\"observations\".\"evidence_state\" IS NULL OR \"conditions\".\"observations\".\"evidence_state\" IN ('self_reported','corroborated','externally_resolved','negated','expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_observation": { - "name": "idx_report_evidence_observation", - "columns": [ - { - "expression": "observation_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"conditions\".\"report_evidence\".\"evidence_kind\" IN ('report','confirm','negate','official_match','reviewer_accept','reviewer_reject','expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "sensor_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_sample": { - "name": "sensor_speed_sample", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_sample_key_bucket": { - "name": "idx_sensor_sample_key_bucket", - "columns": [ - { - "expression": "sensor_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_hour", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sensor_sample_observed": { - "name": "idx_sensor_sample_observed", - "columns": [ - { - "expression": "observed_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_sensor_sample_key_observed": { - "name": "uq_sensor_sample_key_observed", - "nullsNotDistinct": false, - "columns": [ - "sensor_key", - "observed_at" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_subject": { - "name": "idx_sub_claim_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"conditions\".\"sub_claim\".\"claim_type\" IN ('confirm','negate','flag')" - } - }, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0015_snapshot.json b/packages/core/drizzle/meta/0015_snapshot.json deleted file mode 100644 index f734f5385..000000000 --- a/packages/core/drizzle/meta/0015_snapshot.json +++ /dev/null @@ -1,2129 +0,0 @@ -{ - "id": "3786208b-7d8d-43b9-b74f-bf71dec765b4", - "prevId": "524c99ba-a894-4395-987a-54520aec6b0d", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "object_id": { - "name": "object_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_snapshot": { - "name": "payload_snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_object": { - "name": "idx_federation_outbox_object", - "columns": [ - { - "expression": "object_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - } - }, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observations": { - "name": "observations", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_format": { - "name": "source_format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity_source": { - "name": "severity_source", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "headline": { - "name": "headline", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "metric": { - "name": "metric", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "level": { - "name": "level", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "aggregation": { - "name": "aggregation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "subject": { - "name": "subject", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "attributes": { - "name": "attributes", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "schedule": { - "name": "schedule", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_forecast": { - "name": "is_forecast", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "related_ids": { - "name": "related_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "origin": { - "name": "origin", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "data_updated_at": { - "name": "data_updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "is_stale": { - "name": "is_stale", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "stale_after": { - "name": "stale_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "phenomenon_fingerprint": { - "name": "phenomenon_fingerprint", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "replaces": { - "name": "replaces", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "fuzziness": { - "name": "fuzziness", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'exact'" - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'unknown'" - }, - "k_anonymity": { - "name": "k_anonymity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "dp_epsilon": { - "name": "dp_epsilon", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "dp_delta": { - "name": "dp_delta", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "informed": { - "name": "informed", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "source_uri": { - "name": "source_uri", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_license": { - "name": "source_license", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_conditions_obs_geom": { - "name": "idx_conditions_obs_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_conditions_obs_domain": { - "name": "idx_conditions_obs_domain", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_dom_type": { - "name": "idx_conditions_obs_dom_type", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_severity": { - "name": "idx_conditions_obs_severity", - "columns": [ - { - "expression": "severity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_metric": { - "name": "idx_conditions_obs_metric", - "columns": [ - { - "expression": "metric", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_valid_to": { - "name": "idx_conditions_obs_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_expires": { - "name": "idx_conditions_obs_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_subject": { - "name": "idx_conditions_obs_subject", - "columns": [ - { - "expression": "subject", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_source": { - "name": "idx_conditions_obs_source", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_canonical": { - "name": "idx_conditions_obs_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_phenomenon": { - "name": "idx_conditions_obs_phenomenon", - "columns": [ - { - "expression": "phenomenon_fingerprint", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_instance": { - "name": "idx_conditions_obs_instance", - "columns": [ - { - "expression": "instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_privacy": { - "name": "idx_conditions_obs_privacy", - "columns": [ - { - "expression": "privacy_class", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_evidence_state": { - "name": "idx_conditions_obs_evidence_state", - "columns": [ - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_flagged": { - "name": "idx_conditions_obs_flagged", - "columns": [ - { - "expression": "flagged_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observations\".\"flagged_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "obs_confidence_score_range": { - "name": "obs_confidence_score_range", - "value": "\"conditions\".\"observations\".\"confidence_score\" IS NULL OR (\"conditions\".\"observations\".\"confidence_score\" >= 0 AND \"conditions\".\"observations\".\"confidence_score\" <= 1)" - }, - "obs_dp_epsilon_nonneg": { - "name": "obs_dp_epsilon_nonneg", - "value": "\"conditions\".\"observations\".\"dp_epsilon\" IS NULL OR \"conditions\".\"observations\".\"dp_epsilon\" >= 0" - }, - "obs_dp_delta_range": { - "name": "obs_dp_delta_range", - "value": "\"conditions\".\"observations\".\"dp_delta\" IS NULL OR (\"conditions\".\"observations\".\"dp_delta\" >= 0 AND \"conditions\".\"observations\".\"dp_delta\" < 1)" - }, - "obs_k_anonymity_positive": { - "name": "obs_k_anonymity_positive", - "value": "\"conditions\".\"observations\".\"k_anonymity\" IS NULL OR \"conditions\".\"observations\".\"k_anonymity\" > 0" - }, - "obs_severity_level_range": { - "name": "obs_severity_level_range", - "value": "\"conditions\".\"observations\".\"severity_level\" IS NULL OR (\"conditions\".\"observations\".\"severity_level\" >= 1 AND \"conditions\".\"observations\".\"severity_level\" <= 5)" - }, - "obs_fuzziness_enum": { - "name": "obs_fuzziness_enum", - "value": "\"conditions\".\"observations\".\"fuzziness\" IN ('exact','low_res','medium_res','end_unknown','start_unknown','extent_unknown')" - }, - "obs_privacy_class_enum": { - "name": "obs_privacy_class_enum", - "value": "\"conditions\".\"observations\".\"privacy_class\" IN ('unknown','authoritative','aggregate','k_anon','dp_noised','crowd_pseudonym')" - }, - "obs_evidence_state_enum": { - "name": "obs_evidence_state_enum", - "value": "\"conditions\".\"observations\".\"evidence_state\" IS NULL OR \"conditions\".\"observations\".\"evidence_state\" IN ('self_reported','corroborated','externally_resolved','negated','expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_observation": { - "name": "idx_report_evidence_observation", - "columns": [ - { - "expression": "observation_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"conditions\".\"report_evidence\".\"evidence_kind\" IN ('report','confirm','negate','official_match','reviewer_accept','reviewer_reject','expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "sensor_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_sample": { - "name": "sensor_speed_sample", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_sample_key_bucket": { - "name": "idx_sensor_sample_key_bucket", - "columns": [ - { - "expression": "sensor_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_hour", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sensor_sample_observed": { - "name": "idx_sensor_sample_observed", - "columns": [ - { - "expression": "observed_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_sensor_sample_key_observed": { - "name": "uq_sensor_sample_key_observed", - "nullsNotDistinct": false, - "columns": [ - "sensor_key", - "observed_at" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_subject": { - "name": "idx_sub_claim_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"conditions\".\"sub_claim\".\"claim_type\" IN ('confirm','negate','flag')" - } - }, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0016_snapshot.json b/packages/core/drizzle/meta/0016_snapshot.json deleted file mode 100644 index 987c0d547..000000000 --- a/packages/core/drizzle/meta/0016_snapshot.json +++ /dev/null @@ -1,2235 +0,0 @@ -{ - "id": "e05de043-5480-4b5a-aa97-a0d83b75c406", - "prevId": "3786208b-7d8d-43b9-b74f-bf71dec765b4", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "object_id": { - "name": "object_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_snapshot": { - "name": "payload_snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_object": { - "name": "idx_federation_outbox_object", - "columns": [ - { - "expression": "object_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observations": { - "name": "observations", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_format": { - "name": "source_format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity_source": { - "name": "severity_source", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "headline": { - "name": "headline", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "metric": { - "name": "metric", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "level": { - "name": "level", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "aggregation": { - "name": "aggregation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "subject": { - "name": "subject", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "attributes": { - "name": "attributes", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "schedule": { - "name": "schedule", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_forecast": { - "name": "is_forecast", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "related_ids": { - "name": "related_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "origin": { - "name": "origin", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "data_updated_at": { - "name": "data_updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "is_stale": { - "name": "is_stale", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "stale_after": { - "name": "stale_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "phenomenon_fingerprint": { - "name": "phenomenon_fingerprint", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "replaces": { - "name": "replaces", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "fuzziness": { - "name": "fuzziness", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'exact'" - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'unknown'" - }, - "k_anonymity": { - "name": "k_anonymity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "dp_epsilon": { - "name": "dp_epsilon", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "dp_delta": { - "name": "dp_delta", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "informed": { - "name": "informed", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "source_uri": { - "name": "source_uri", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_license": { - "name": "source_license", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_conditions_obs_geom": { - "name": "idx_conditions_obs_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_conditions_obs_domain": { - "name": "idx_conditions_obs_domain", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_dom_type": { - "name": "idx_conditions_obs_dom_type", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_severity": { - "name": "idx_conditions_obs_severity", - "columns": [ - { - "expression": "severity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_metric": { - "name": "idx_conditions_obs_metric", - "columns": [ - { - "expression": "metric", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_valid_to": { - "name": "idx_conditions_obs_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_expires": { - "name": "idx_conditions_obs_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_subject": { - "name": "idx_conditions_obs_subject", - "columns": [ - { - "expression": "subject", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_source": { - "name": "idx_conditions_obs_source", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_canonical": { - "name": "idx_conditions_obs_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_phenomenon": { - "name": "idx_conditions_obs_phenomenon", - "columns": [ - { - "expression": "phenomenon_fingerprint", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_instance": { - "name": "idx_conditions_obs_instance", - "columns": [ - { - "expression": "instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_privacy": { - "name": "idx_conditions_obs_privacy", - "columns": [ - { - "expression": "privacy_class", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_evidence_state": { - "name": "idx_conditions_obs_evidence_state", - "columns": [ - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_flagged": { - "name": "idx_conditions_obs_flagged", - "columns": [ - { - "expression": "flagged_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observations\".\"flagged_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "obs_confidence_score_range": { - "name": "obs_confidence_score_range", - "value": "\"conditions\".\"observations\".\"confidence_score\" IS NULL OR (\"conditions\".\"observations\".\"confidence_score\" >= 0 AND \"conditions\".\"observations\".\"confidence_score\" <= 1)" - }, - "obs_dp_epsilon_nonneg": { - "name": "obs_dp_epsilon_nonneg", - "value": "\"conditions\".\"observations\".\"dp_epsilon\" IS NULL OR \"conditions\".\"observations\".\"dp_epsilon\" >= 0" - }, - "obs_dp_delta_range": { - "name": "obs_dp_delta_range", - "value": "\"conditions\".\"observations\".\"dp_delta\" IS NULL OR (\"conditions\".\"observations\".\"dp_delta\" >= 0 AND \"conditions\".\"observations\".\"dp_delta\" < 1)" - }, - "obs_k_anonymity_positive": { - "name": "obs_k_anonymity_positive", - "value": "\"conditions\".\"observations\".\"k_anonymity\" IS NULL OR \"conditions\".\"observations\".\"k_anonymity\" > 0" - }, - "obs_severity_level_range": { - "name": "obs_severity_level_range", - "value": "\"conditions\".\"observations\".\"severity_level\" IS NULL OR (\"conditions\".\"observations\".\"severity_level\" >= 1 AND \"conditions\".\"observations\".\"severity_level\" <= 5)" - }, - "obs_fuzziness_enum": { - "name": "obs_fuzziness_enum", - "value": "\"conditions\".\"observations\".\"fuzziness\" IN ('exact','low_res','medium_res','end_unknown','start_unknown','extent_unknown')" - }, - "obs_privacy_class_enum": { - "name": "obs_privacy_class_enum", - "value": "\"conditions\".\"observations\".\"privacy_class\" IN ('unknown','authoritative','aggregate','k_anon','dp_noised','crowd_pseudonym')" - }, - "obs_evidence_state_enum": { - "name": "obs_evidence_state_enum", - "value": "\"conditions\".\"observations\".\"evidence_state\" IS NULL OR \"conditions\".\"observations\".\"evidence_state\" IN ('self_reported','corroborated','externally_resolved','negated','expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_observation": { - "name": "idx_report_evidence_observation", - "columns": [ - { - "expression": "observation_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"conditions\".\"report_evidence\".\"evidence_kind\" IN ('report','confirm','negate','official_match','reviewer_accept','reviewer_reject','expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "sensor_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_sample": { - "name": "sensor_speed_sample", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_sample_key_bucket": { - "name": "idx_sensor_sample_key_bucket", - "columns": [ - { - "expression": "sensor_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_hour", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sensor_sample_observed": { - "name": "idx_sensor_sample_observed", - "columns": [ - { - "expression": "observed_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_sensor_sample_key_observed": { - "name": "uq_sensor_sample_key_observed", - "nullsNotDistinct": false, - "columns": [ - "sensor_key", - "observed_at" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_subject": { - "name": "idx_sub_claim_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"conditions\".\"sub_claim\".\"claim_type\" IN ('confirm','negate','flag')" - } - }, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0017_snapshot.json b/packages/core/drizzle/meta/0017_snapshot.json deleted file mode 100644 index 95b633f01..000000000 --- a/packages/core/drizzle/meta/0017_snapshot.json +++ /dev/null @@ -1,2250 +0,0 @@ -{ - "id": "155817a7-4895-4036-97da-28fcc349d31e", - "prevId": "e05de043-5480-4b5a-aa97-a0d83b75c406", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "object_id": { - "name": "object_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_snapshot": { - "name": "payload_snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_object": { - "name": "idx_federation_outbox_object", - "columns": [ - { - "expression": "object_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observations": { - "name": "observations", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_format": { - "name": "source_format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity_source": { - "name": "severity_source", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "headline": { - "name": "headline", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "metric": { - "name": "metric", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "level": { - "name": "level", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "aggregation": { - "name": "aggregation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "subject": { - "name": "subject", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "attributes": { - "name": "attributes", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "schedule": { - "name": "schedule", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_forecast": { - "name": "is_forecast", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "related_ids": { - "name": "related_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "origin": { - "name": "origin", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "data_updated_at": { - "name": "data_updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "is_stale": { - "name": "is_stale", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "stale_after": { - "name": "stale_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "phenomenon_fingerprint": { - "name": "phenomenon_fingerprint", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "replaces": { - "name": "replaces", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "fuzziness": { - "name": "fuzziness", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'exact'" - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'unknown'" - }, - "k_anonymity": { - "name": "k_anonymity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "dp_epsilon": { - "name": "dp_epsilon", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "dp_delta": { - "name": "dp_delta", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "informed": { - "name": "informed", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "source_uri": { - "name": "source_uri", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_license": { - "name": "source_license", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_conditions_obs_geom": { - "name": "idx_conditions_obs_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_conditions_obs_domain": { - "name": "idx_conditions_obs_domain", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_dom_type": { - "name": "idx_conditions_obs_dom_type", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_severity": { - "name": "idx_conditions_obs_severity", - "columns": [ - { - "expression": "severity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_metric": { - "name": "idx_conditions_obs_metric", - "columns": [ - { - "expression": "metric", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_valid_to": { - "name": "idx_conditions_obs_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_expires": { - "name": "idx_conditions_obs_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_subject": { - "name": "idx_conditions_obs_subject", - "columns": [ - { - "expression": "subject", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_source": { - "name": "idx_conditions_obs_source", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_canonical": { - "name": "idx_conditions_obs_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_content_hash": { - "name": "idx_conditions_obs_content_hash", - "columns": [ - { - "expression": "content_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_phenomenon": { - "name": "idx_conditions_obs_phenomenon", - "columns": [ - { - "expression": "phenomenon_fingerprint", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_instance": { - "name": "idx_conditions_obs_instance", - "columns": [ - { - "expression": "instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_privacy": { - "name": "idx_conditions_obs_privacy", - "columns": [ - { - "expression": "privacy_class", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_evidence_state": { - "name": "idx_conditions_obs_evidence_state", - "columns": [ - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_flagged": { - "name": "idx_conditions_obs_flagged", - "columns": [ - { - "expression": "flagged_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observations\".\"flagged_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "obs_confidence_score_range": { - "name": "obs_confidence_score_range", - "value": "\"conditions\".\"observations\".\"confidence_score\" IS NULL OR (\"conditions\".\"observations\".\"confidence_score\" >= 0 AND \"conditions\".\"observations\".\"confidence_score\" <= 1)" - }, - "obs_dp_epsilon_nonneg": { - "name": "obs_dp_epsilon_nonneg", - "value": "\"conditions\".\"observations\".\"dp_epsilon\" IS NULL OR \"conditions\".\"observations\".\"dp_epsilon\" >= 0" - }, - "obs_dp_delta_range": { - "name": "obs_dp_delta_range", - "value": "\"conditions\".\"observations\".\"dp_delta\" IS NULL OR (\"conditions\".\"observations\".\"dp_delta\" >= 0 AND \"conditions\".\"observations\".\"dp_delta\" < 1)" - }, - "obs_k_anonymity_positive": { - "name": "obs_k_anonymity_positive", - "value": "\"conditions\".\"observations\".\"k_anonymity\" IS NULL OR \"conditions\".\"observations\".\"k_anonymity\" > 0" - }, - "obs_severity_level_range": { - "name": "obs_severity_level_range", - "value": "\"conditions\".\"observations\".\"severity_level\" IS NULL OR (\"conditions\".\"observations\".\"severity_level\" >= 1 AND \"conditions\".\"observations\".\"severity_level\" <= 5)" - }, - "obs_fuzziness_enum": { - "name": "obs_fuzziness_enum", - "value": "\"conditions\".\"observations\".\"fuzziness\" IN ('exact','low_res','medium_res','end_unknown','start_unknown','extent_unknown')" - }, - "obs_privacy_class_enum": { - "name": "obs_privacy_class_enum", - "value": "\"conditions\".\"observations\".\"privacy_class\" IN ('unknown','authoritative','aggregate','k_anon','dp_noised','crowd_pseudonym')" - }, - "obs_evidence_state_enum": { - "name": "obs_evidence_state_enum", - "value": "\"conditions\".\"observations\".\"evidence_state\" IS NULL OR \"conditions\".\"observations\".\"evidence_state\" IN ('self_reported','corroborated','externally_resolved','negated','expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_observation": { - "name": "idx_report_evidence_observation", - "columns": [ - { - "expression": "observation_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"conditions\".\"report_evidence\".\"evidence_kind\" IN ('report','confirm','negate','official_match','reviewer_accept','reviewer_reject','expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "sensor_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_sample": { - "name": "sensor_speed_sample", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_sample_key_bucket": { - "name": "idx_sensor_sample_key_bucket", - "columns": [ - { - "expression": "sensor_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_hour", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sensor_sample_observed": { - "name": "idx_sensor_sample_observed", - "columns": [ - { - "expression": "observed_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_sensor_sample_key_observed": { - "name": "uq_sensor_sample_key_observed", - "nullsNotDistinct": false, - "columns": [ - "sensor_key", - "observed_at" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_subject": { - "name": "idx_sub_claim_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"conditions\".\"sub_claim\".\"claim_type\" IN ('confirm','negate','flag')" - } - }, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0018_snapshot.json b/packages/core/drizzle/meta/0018_snapshot.json deleted file mode 100644 index d632c3ab0..000000000 --- a/packages/core/drizzle/meta/0018_snapshot.json +++ /dev/null @@ -1,2260 +0,0 @@ -{ - "id": "b647c582-e395-4eba-a5c0-bcd10817981c", - "prevId": "155817a7-4895-4036-97da-28fcc349d31e", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "object_id": { - "name": "object_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_snapshot": { - "name": "payload_snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_object": { - "name": "idx_federation_outbox_object", - "columns": [ - { - "expression": "object_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observations": { - "name": "observations", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_format": { - "name": "source_format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity_source": { - "name": "severity_source", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "headline": { - "name": "headline", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "metric": { - "name": "metric", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "level": { - "name": "level", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "aggregation": { - "name": "aggregation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "subject": { - "name": "subject", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "attributes": { - "name": "attributes", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "schedule": { - "name": "schedule", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_forecast": { - "name": "is_forecast", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "related_ids": { - "name": "related_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "origin": { - "name": "origin", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "data_updated_at": { - "name": "data_updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "is_stale": { - "name": "is_stale", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "stale_after": { - "name": "stale_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "phenomenon_fingerprint": { - "name": "phenomenon_fingerprint", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "replaces": { - "name": "replaces", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "fuzziness": { - "name": "fuzziness", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'exact'" - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'unknown'" - }, - "k_anonymity": { - "name": "k_anonymity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "dp_epsilon": { - "name": "dp_epsilon", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "dp_delta": { - "name": "dp_delta", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "informed": { - "name": "informed", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "source_uri": { - "name": "source_uri", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_license": { - "name": "source_license", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_conditions_obs_geom": { - "name": "idx_conditions_obs_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_conditions_obs_domain": { - "name": "idx_conditions_obs_domain", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_dom_type": { - "name": "idx_conditions_obs_dom_type", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_severity": { - "name": "idx_conditions_obs_severity", - "columns": [ - { - "expression": "severity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_metric": { - "name": "idx_conditions_obs_metric", - "columns": [ - { - "expression": "metric", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_valid_to": { - "name": "idx_conditions_obs_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_expires": { - "name": "idx_conditions_obs_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_subject": { - "name": "idx_conditions_obs_subject", - "columns": [ - { - "expression": "subject", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_source": { - "name": "idx_conditions_obs_source", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_canonical": { - "name": "idx_conditions_obs_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_content_hash": { - "name": "idx_conditions_obs_content_hash", - "columns": [ - { - "expression": "content_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_phenomenon": { - "name": "idx_conditions_obs_phenomenon", - "columns": [ - { - "expression": "phenomenon_fingerprint", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_instance": { - "name": "idx_conditions_obs_instance", - "columns": [ - { - "expression": "instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_privacy": { - "name": "idx_conditions_obs_privacy", - "columns": [ - { - "expression": "privacy_class", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_evidence_state": { - "name": "idx_conditions_obs_evidence_state", - "columns": [ - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_flagged": { - "name": "idx_conditions_obs_flagged", - "columns": [ - { - "expression": "flagged_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observations\".\"flagged_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "obs_confidence_score_range": { - "name": "obs_confidence_score_range", - "value": "\"conditions\".\"observations\".\"confidence_score\" IS NULL OR (\"conditions\".\"observations\".\"confidence_score\" >= 0 AND \"conditions\".\"observations\".\"confidence_score\" <= 1)" - }, - "obs_dp_epsilon_nonneg": { - "name": "obs_dp_epsilon_nonneg", - "value": "\"conditions\".\"observations\".\"dp_epsilon\" IS NULL OR \"conditions\".\"observations\".\"dp_epsilon\" >= 0" - }, - "obs_dp_delta_range": { - "name": "obs_dp_delta_range", - "value": "\"conditions\".\"observations\".\"dp_delta\" IS NULL OR (\"conditions\".\"observations\".\"dp_delta\" >= 0 AND \"conditions\".\"observations\".\"dp_delta\" < 1)" - }, - "obs_k_anonymity_positive": { - "name": "obs_k_anonymity_positive", - "value": "\"conditions\".\"observations\".\"k_anonymity\" IS NULL OR \"conditions\".\"observations\".\"k_anonymity\" > 0" - }, - "obs_severity_level_range": { - "name": "obs_severity_level_range", - "value": "\"conditions\".\"observations\".\"severity_level\" IS NULL OR (\"conditions\".\"observations\".\"severity_level\" >= 1 AND \"conditions\".\"observations\".\"severity_level\" <= 5)" - }, - "obs_fuzziness_enum": { - "name": "obs_fuzziness_enum", - "value": "\"conditions\".\"observations\".\"fuzziness\" IN ('exact','low_res','medium_res','end_unknown','start_unknown','extent_unknown')" - }, - "obs_privacy_class_enum": { - "name": "obs_privacy_class_enum", - "value": "\"conditions\".\"observations\".\"privacy_class\" IN ('unknown','authoritative','aggregate','k_anon','dp_noised','crowd_pseudonym')" - }, - "obs_evidence_state_enum": { - "name": "obs_evidence_state_enum", - "value": "\"conditions\".\"observations\".\"evidence_state\" IS NULL OR \"conditions\".\"observations\".\"evidence_state\" IN ('self_reported','corroborated','externally_resolved','negated','expired')" - }, - "obs_tombstone_reason_enum": { - "name": "obs_tombstone_reason_enum", - "value": "\"conditions\".\"observations\".\"tombstone_reason\" IS NULL OR \"conditions\".\"observations\".\"tombstone_reason\" IN ('deleted_by_source','gdpr_erasure','retracted_as_wrong','expired','legal_takedown')" - } - }, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_observation": { - "name": "idx_report_evidence_observation", - "columns": [ - { - "expression": "observation_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"conditions\".\"report_evidence\".\"evidence_kind\" IN ('report','confirm','negate','official_match','reviewer_accept','reviewer_reject','expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "sensor_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_sample": { - "name": "sensor_speed_sample", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_sample_key_bucket": { - "name": "idx_sensor_sample_key_bucket", - "columns": [ - { - "expression": "sensor_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_hour", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sensor_sample_observed": { - "name": "idx_sensor_sample_observed", - "columns": [ - { - "expression": "observed_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_sensor_sample_key_observed": { - "name": "uq_sensor_sample_key_observed", - "nullsNotDistinct": false, - "columns": [ - "sensor_key", - "observed_at" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_subject": { - "name": "idx_sub_claim_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"conditions\".\"sub_claim\".\"claim_type\" IN ('confirm','negate','flag')" - } - }, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0019_snapshot.json b/packages/core/drizzle/meta/0019_snapshot.json deleted file mode 100644 index b80bb4618..000000000 --- a/packages/core/drizzle/meta/0019_snapshot.json +++ /dev/null @@ -1,2298 +0,0 @@ -{ - "id": "db7ad22f-e0f7-48f2-a51a-4e8f9fab127e", - "prevId": "b647c582-e395-4eba-a5c0-bcd10817981c", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "object_id": { - "name": "object_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_snapshot": { - "name": "payload_snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_object": { - "name": "idx_federation_outbox_object", - "columns": [ - { - "expression": "object_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observations": { - "name": "observations", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_format": { - "name": "source_format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity_source": { - "name": "severity_source", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "headline": { - "name": "headline", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "metric": { - "name": "metric", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "level": { - "name": "level", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "aggregation": { - "name": "aggregation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "subject": { - "name": "subject", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "attributes": { - "name": "attributes", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "schedule": { - "name": "schedule", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_forecast": { - "name": "is_forecast", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "related_ids": { - "name": "related_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "origin": { - "name": "origin", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "data_updated_at": { - "name": "data_updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "is_stale": { - "name": "is_stale", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "stale_after": { - "name": "stale_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "phenomenon_fingerprint": { - "name": "phenomenon_fingerprint", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "replaces": { - "name": "replaces", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "fuzziness": { - "name": "fuzziness", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'exact'" - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'unknown'" - }, - "k_anonymity": { - "name": "k_anonymity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "dp_epsilon": { - "name": "dp_epsilon", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "dp_delta": { - "name": "dp_delta", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "informed": { - "name": "informed", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "source_uri": { - "name": "source_uri", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_license": { - "name": "source_license", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_conditions_obs_geom": { - "name": "idx_conditions_obs_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_conditions_obs_domain": { - "name": "idx_conditions_obs_domain", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_dom_type": { - "name": "idx_conditions_obs_dom_type", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_severity": { - "name": "idx_conditions_obs_severity", - "columns": [ - { - "expression": "severity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_metric": { - "name": "idx_conditions_obs_metric", - "columns": [ - { - "expression": "metric", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_valid_to": { - "name": "idx_conditions_obs_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_expires": { - "name": "idx_conditions_obs_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_subject": { - "name": "idx_conditions_obs_subject", - "columns": [ - { - "expression": "subject", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_source": { - "name": "idx_conditions_obs_source", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_canonical": { - "name": "idx_conditions_obs_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_content_hash": { - "name": "idx_conditions_obs_content_hash", - "columns": [ - { - "expression": "content_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_phenomenon": { - "name": "idx_conditions_obs_phenomenon", - "columns": [ - { - "expression": "phenomenon_fingerprint", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_instance": { - "name": "idx_conditions_obs_instance", - "columns": [ - { - "expression": "instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_privacy": { - "name": "idx_conditions_obs_privacy", - "columns": [ - { - "expression": "privacy_class", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_evidence_state": { - "name": "idx_conditions_obs_evidence_state", - "columns": [ - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_flagged": { - "name": "idx_conditions_obs_flagged", - "columns": [ - { - "expression": "flagged_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observations\".\"flagged_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "obs_confidence_score_range": { - "name": "obs_confidence_score_range", - "value": "\"conditions\".\"observations\".\"confidence_score\" IS NULL OR (\"conditions\".\"observations\".\"confidence_score\" >= 0 AND \"conditions\".\"observations\".\"confidence_score\" <= 1)" - }, - "obs_dp_epsilon_nonneg": { - "name": "obs_dp_epsilon_nonneg", - "value": "\"conditions\".\"observations\".\"dp_epsilon\" IS NULL OR \"conditions\".\"observations\".\"dp_epsilon\" >= 0" - }, - "obs_dp_delta_range": { - "name": "obs_dp_delta_range", - "value": "\"conditions\".\"observations\".\"dp_delta\" IS NULL OR (\"conditions\".\"observations\".\"dp_delta\" >= 0 AND \"conditions\".\"observations\".\"dp_delta\" < 1)" - }, - "obs_k_anonymity_positive": { - "name": "obs_k_anonymity_positive", - "value": "\"conditions\".\"observations\".\"k_anonymity\" IS NULL OR \"conditions\".\"observations\".\"k_anonymity\" > 0" - }, - "obs_severity_level_range": { - "name": "obs_severity_level_range", - "value": "\"conditions\".\"observations\".\"severity_level\" IS NULL OR (\"conditions\".\"observations\".\"severity_level\" >= 1 AND \"conditions\".\"observations\".\"severity_level\" <= 5)" - }, - "obs_fuzziness_enum": { - "name": "obs_fuzziness_enum", - "value": "\"conditions\".\"observations\".\"fuzziness\" IN ('exact','low_res','medium_res','end_unknown','start_unknown','extent_unknown')" - }, - "obs_privacy_class_enum": { - "name": "obs_privacy_class_enum", - "value": "\"conditions\".\"observations\".\"privacy_class\" IN ('unknown','authoritative','aggregate','k_anon','dp_noised','crowd_pseudonym')" - }, - "obs_evidence_state_enum": { - "name": "obs_evidence_state_enum", - "value": "\"conditions\".\"observations\".\"evidence_state\" IS NULL OR \"conditions\".\"observations\".\"evidence_state\" IN ('self_reported','corroborated','externally_resolved','negated','expired')" - }, - "obs_tombstone_reason_enum": { - "name": "obs_tombstone_reason_enum", - "value": "\"conditions\".\"observations\".\"tombstone_reason\" IS NULL OR \"conditions\".\"observations\".\"tombstone_reason\" IN ('deleted_by_source','gdpr_erasure','retracted_as_wrong','expired','legal_takedown')" - } - }, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_observation": { - "name": "idx_report_evidence_observation", - "columns": [ - { - "expression": "observation_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"conditions\".\"report_evidence\".\"evidence_kind\" IN ('report','confirm','negate','official_match','reviewer_accept','reviewer_reject','expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "sensor_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_sample": { - "name": "sensor_speed_sample", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_sample_key_bucket": { - "name": "idx_sensor_sample_key_bucket", - "columns": [ - { - "expression": "sensor_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_hour", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sensor_sample_observed": { - "name": "idx_sensor_sample_observed", - "columns": [ - { - "expression": "observed_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_sensor_sample_key_observed": { - "name": "uq_sensor_sample_key_observed", - "nullsNotDistinct": false, - "columns": [ - "sensor_key", - "observed_at" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_subject": { - "name": "idx_sub_claim_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"conditions\".\"sub_claim\".\"claim_type\" IN ('confirm','negate','flag')" - } - }, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0020_snapshot.json b/packages/core/drizzle/meta/0020_snapshot.json deleted file mode 100644 index 9fd057a7c..000000000 --- a/packages/core/drizzle/meta/0020_snapshot.json +++ /dev/null @@ -1,2410 +0,0 @@ -{ - "id": "334654ac-9ba6-4f2f-809a-9640c06a3cd2", - "prevId": "db7ad22f-e0f7-48f2-a51a-4e8f9fab127e", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "object_id": { - "name": "object_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_snapshot": { - "name": "payload_snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_object": { - "name": "idx_federation_outbox_object", - "columns": [ - { - "expression": "object_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observations": { - "name": "observations", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_format": { - "name": "source_format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity_source": { - "name": "severity_source", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "headline": { - "name": "headline", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "metric": { - "name": "metric", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "level": { - "name": "level", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "aggregation": { - "name": "aggregation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "subject": { - "name": "subject", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "attributes": { - "name": "attributes", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "schedule": { - "name": "schedule", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_forecast": { - "name": "is_forecast", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "related_ids": { - "name": "related_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "origin": { - "name": "origin", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "data_updated_at": { - "name": "data_updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "is_stale": { - "name": "is_stale", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "stale_after": { - "name": "stale_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "phenomenon_fingerprint": { - "name": "phenomenon_fingerprint", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "replaces": { - "name": "replaces", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "fuzziness": { - "name": "fuzziness", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'exact'" - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'unknown'" - }, - "k_anonymity": { - "name": "k_anonymity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "dp_epsilon": { - "name": "dp_epsilon", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "dp_delta": { - "name": "dp_delta", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "informed": { - "name": "informed", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "source_uri": { - "name": "source_uri", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_license": { - "name": "source_license", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_conditions_obs_geom": { - "name": "idx_conditions_obs_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_conditions_obs_domain": { - "name": "idx_conditions_obs_domain", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_dom_type": { - "name": "idx_conditions_obs_dom_type", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_severity": { - "name": "idx_conditions_obs_severity", - "columns": [ - { - "expression": "severity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_metric": { - "name": "idx_conditions_obs_metric", - "columns": [ - { - "expression": "metric", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_valid_to": { - "name": "idx_conditions_obs_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_expires": { - "name": "idx_conditions_obs_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_subject": { - "name": "idx_conditions_obs_subject", - "columns": [ - { - "expression": "subject", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_source": { - "name": "idx_conditions_obs_source", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_canonical": { - "name": "idx_conditions_obs_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_content_hash": { - "name": "idx_conditions_obs_content_hash", - "columns": [ - { - "expression": "content_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_phenomenon": { - "name": "idx_conditions_obs_phenomenon", - "columns": [ - { - "expression": "phenomenon_fingerprint", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_instance": { - "name": "idx_conditions_obs_instance", - "columns": [ - { - "expression": "instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_privacy": { - "name": "idx_conditions_obs_privacy", - "columns": [ - { - "expression": "privacy_class", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_evidence_state": { - "name": "idx_conditions_obs_evidence_state", - "columns": [ - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_flagged": { - "name": "idx_conditions_obs_flagged", - "columns": [ - { - "expression": "flagged_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observations\".\"flagged_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "obs_confidence_score_range": { - "name": "obs_confidence_score_range", - "value": "\"conditions\".\"observations\".\"confidence_score\" IS NULL OR (\"conditions\".\"observations\".\"confidence_score\" >= 0 AND \"conditions\".\"observations\".\"confidence_score\" <= 1)" - }, - "obs_dp_epsilon_nonneg": { - "name": "obs_dp_epsilon_nonneg", - "value": "\"conditions\".\"observations\".\"dp_epsilon\" IS NULL OR \"conditions\".\"observations\".\"dp_epsilon\" >= 0" - }, - "obs_dp_delta_range": { - "name": "obs_dp_delta_range", - "value": "\"conditions\".\"observations\".\"dp_delta\" IS NULL OR (\"conditions\".\"observations\".\"dp_delta\" >= 0 AND \"conditions\".\"observations\".\"dp_delta\" < 1)" - }, - "obs_k_anonymity_positive": { - "name": "obs_k_anonymity_positive", - "value": "\"conditions\".\"observations\".\"k_anonymity\" IS NULL OR \"conditions\".\"observations\".\"k_anonymity\" > 0" - }, - "obs_severity_level_range": { - "name": "obs_severity_level_range", - "value": "\"conditions\".\"observations\".\"severity_level\" IS NULL OR (\"conditions\".\"observations\".\"severity_level\" >= 1 AND \"conditions\".\"observations\".\"severity_level\" <= 5)" - }, - "obs_fuzziness_enum": { - "name": "obs_fuzziness_enum", - "value": "\"conditions\".\"observations\".\"fuzziness\" IN ('exact','low_res','medium_res','end_unknown','start_unknown','extent_unknown')" - }, - "obs_privacy_class_enum": { - "name": "obs_privacy_class_enum", - "value": "\"conditions\".\"observations\".\"privacy_class\" IN ('unknown','authoritative','aggregate','k_anon','dp_noised','crowd_pseudonym')" - }, - "obs_evidence_state_enum": { - "name": "obs_evidence_state_enum", - "value": "\"conditions\".\"observations\".\"evidence_state\" IS NULL OR \"conditions\".\"observations\".\"evidence_state\" IN ('self_reported','corroborated','externally_resolved','negated','expired')" - }, - "obs_tombstone_reason_enum": { - "name": "obs_tombstone_reason_enum", - "value": "\"conditions\".\"observations\".\"tombstone_reason\" IS NULL OR \"conditions\".\"observations\".\"tombstone_reason\" IN ('deleted_by_source','gdpr_erasure','retracted_as_wrong','expired','legal_takedown')" - } - }, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_observation": { - "name": "idx_report_evidence_observation", - "columns": [ - { - "expression": "observation_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"conditions\".\"report_evidence\".\"evidence_kind\" IN ('report','confirm','negate','official_match','reviewer_accept','reviewer_reject','expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "sensor_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_sample": { - "name": "sensor_speed_sample", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_sample_key_bucket": { - "name": "idx_sensor_sample_key_bucket", - "columns": [ - { - "expression": "sensor_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_hour", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sensor_sample_observed": { - "name": "idx_sensor_sample_observed", - "columns": [ - { - "expression": "observed_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_sensor_sample_key_observed": { - "name": "uq_sensor_sample_key_observed", - "nullsNotDistinct": false, - "columns": [ - "sensor_key", - "observed_at" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_subject": { - "name": "idx_sub_claim_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"conditions\".\"sub_claim\".\"claim_type\" IN ('confirm','negate','flag')" - } - }, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0021_snapshot.json b/packages/core/drizzle/meta/0021_snapshot.json deleted file mode 100644 index d1d75614b..000000000 --- a/packages/core/drizzle/meta/0021_snapshot.json +++ /dev/null @@ -1,2425 +0,0 @@ -{ - "id": "0805d273-2967-492f-a7d0-c25875ccd7ee", - "prevId": "334654ac-9ba6-4f2f-809a-9640c06a3cd2", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "object_id": { - "name": "object_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_snapshot": { - "name": "payload_snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_object": { - "name": "idx_federation_outbox_object", - "columns": [ - { - "expression": "object_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observations": { - "name": "observations", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_format": { - "name": "source_format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity_source": { - "name": "severity_source", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "headline": { - "name": "headline", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "metric": { - "name": "metric", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "level": { - "name": "level", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "aggregation": { - "name": "aggregation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "subject": { - "name": "subject", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "attributes": { - "name": "attributes", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "schedule": { - "name": "schedule", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_forecast": { - "name": "is_forecast", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "related_ids": { - "name": "related_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "origin": { - "name": "origin", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "data_updated_at": { - "name": "data_updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "is_stale": { - "name": "is_stale", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "stale_after": { - "name": "stale_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "phenomenon_fingerprint": { - "name": "phenomenon_fingerprint", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "replaces": { - "name": "replaces", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "fuzziness": { - "name": "fuzziness", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'exact'" - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'unknown'" - }, - "k_anonymity": { - "name": "k_anonymity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "dp_epsilon": { - "name": "dp_epsilon", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "dp_delta": { - "name": "dp_delta", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "informed": { - "name": "informed", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "source_uri": { - "name": "source_uri", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_license": { - "name": "source_license", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_conditions_obs_geom": { - "name": "idx_conditions_obs_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_conditions_obs_domain": { - "name": "idx_conditions_obs_domain", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_dom_type": { - "name": "idx_conditions_obs_dom_type", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_severity": { - "name": "idx_conditions_obs_severity", - "columns": [ - { - "expression": "severity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_metric": { - "name": "idx_conditions_obs_metric", - "columns": [ - { - "expression": "metric", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_valid_to": { - "name": "idx_conditions_obs_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_expires": { - "name": "idx_conditions_obs_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_subject": { - "name": "idx_conditions_obs_subject", - "columns": [ - { - "expression": "subject", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_source": { - "name": "idx_conditions_obs_source", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_canonical": { - "name": "idx_conditions_obs_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_content_hash": { - "name": "idx_conditions_obs_content_hash", - "columns": [ - { - "expression": "content_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_phenomenon": { - "name": "idx_conditions_obs_phenomenon", - "columns": [ - { - "expression": "phenomenon_fingerprint", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_instance": { - "name": "idx_conditions_obs_instance", - "columns": [ - { - "expression": "instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_privacy": { - "name": "idx_conditions_obs_privacy", - "columns": [ - { - "expression": "privacy_class", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_evidence_state": { - "name": "idx_conditions_obs_evidence_state", - "columns": [ - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_flagged": { - "name": "idx_conditions_obs_flagged", - "columns": [ - { - "expression": "flagged_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observations\".\"flagged_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "obs_confidence_score_range": { - "name": "obs_confidence_score_range", - "value": "\"conditions\".\"observations\".\"confidence_score\" IS NULL OR (\"conditions\".\"observations\".\"confidence_score\" >= 0 AND \"conditions\".\"observations\".\"confidence_score\" <= 1)" - }, - "obs_dp_epsilon_nonneg": { - "name": "obs_dp_epsilon_nonneg", - "value": "\"conditions\".\"observations\".\"dp_epsilon\" IS NULL OR \"conditions\".\"observations\".\"dp_epsilon\" >= 0" - }, - "obs_dp_delta_range": { - "name": "obs_dp_delta_range", - "value": "\"conditions\".\"observations\".\"dp_delta\" IS NULL OR (\"conditions\".\"observations\".\"dp_delta\" >= 0 AND \"conditions\".\"observations\".\"dp_delta\" < 1)" - }, - "obs_k_anonymity_positive": { - "name": "obs_k_anonymity_positive", - "value": "\"conditions\".\"observations\".\"k_anonymity\" IS NULL OR \"conditions\".\"observations\".\"k_anonymity\" > 0" - }, - "obs_severity_level_range": { - "name": "obs_severity_level_range", - "value": "\"conditions\".\"observations\".\"severity_level\" IS NULL OR (\"conditions\".\"observations\".\"severity_level\" >= 1 AND \"conditions\".\"observations\".\"severity_level\" <= 5)" - }, - "obs_fuzziness_enum": { - "name": "obs_fuzziness_enum", - "value": "\"conditions\".\"observations\".\"fuzziness\" IN ('exact','low_res','medium_res','end_unknown','start_unknown','extent_unknown')" - }, - "obs_privacy_class_enum": { - "name": "obs_privacy_class_enum", - "value": "\"conditions\".\"observations\".\"privacy_class\" IN ('unknown','authoritative','aggregate','k_anon','dp_noised','crowd_pseudonym')" - }, - "obs_evidence_state_enum": { - "name": "obs_evidence_state_enum", - "value": "\"conditions\".\"observations\".\"evidence_state\" IS NULL OR \"conditions\".\"observations\".\"evidence_state\" IN ('self_reported','corroborated','externally_resolved','negated','expired')" - }, - "obs_tombstone_reason_enum": { - "name": "obs_tombstone_reason_enum", - "value": "\"conditions\".\"observations\".\"tombstone_reason\" IS NULL OR \"conditions\".\"observations\".\"tombstone_reason\" IN ('deleted_by_source','gdpr_erasure','retracted_as_wrong','expired','legal_takedown')" - } - }, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_observation": { - "name": "idx_report_evidence_observation", - "columns": [ - { - "expression": "observation_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"conditions\".\"report_evidence\".\"evidence_kind\" IN ('report','confirm','negate','official_match','reviewer_accept','reviewer_reject','expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "sensor_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_sample": { - "name": "sensor_speed_sample", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_sample_key_bucket": { - "name": "idx_sensor_sample_key_bucket", - "columns": [ - { - "expression": "sensor_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_hour", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sensor_sample_observed": { - "name": "idx_sensor_sample_observed", - "columns": [ - { - "expression": "observed_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_sensor_sample_key_observed": { - "name": "uq_sensor_sample_key_observed", - "nullsNotDistinct": false, - "columns": [ - "sensor_key", - "observed_at" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_subject": { - "name": "idx_sub_claim_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"conditions\".\"sub_claim\".\"claim_type\" IN ('confirm','negate','flag')" - } - }, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0022_snapshot.json b/packages/core/drizzle/meta/0022_snapshot.json deleted file mode 100644 index e31e71fa0..000000000 --- a/packages/core/drizzle/meta/0022_snapshot.json +++ /dev/null @@ -1,2455 +0,0 @@ -{ - "id": "d78e8c0e-353c-4d80-a10d-989b86a724f8", - "prevId": "0805d273-2967-492f-a7d0-c25875ccd7ee", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "object_id": { - "name": "object_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_snapshot": { - "name": "payload_snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_object": { - "name": "idx_federation_outbox_object", - "columns": [ - { - "expression": "object_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observations": { - "name": "observations", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_format": { - "name": "source_format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity_source": { - "name": "severity_source", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "headline": { - "name": "headline", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "metric": { - "name": "metric", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "level": { - "name": "level", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "aggregation": { - "name": "aggregation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "subject": { - "name": "subject", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "attributes": { - "name": "attributes", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "schedule": { - "name": "schedule", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_forecast": { - "name": "is_forecast", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "related_ids": { - "name": "related_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "origin": { - "name": "origin", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "data_updated_at": { - "name": "data_updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "is_stale": { - "name": "is_stale", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "stale_after": { - "name": "stale_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "phenomenon_fingerprint": { - "name": "phenomenon_fingerprint", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "replaces": { - "name": "replaces", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "fuzziness": { - "name": "fuzziness", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'exact'" - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'unknown'" - }, - "k_anonymity": { - "name": "k_anonymity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "dp_epsilon": { - "name": "dp_epsilon", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "dp_delta": { - "name": "dp_delta", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "informed": { - "name": "informed", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "source_uri": { - "name": "source_uri", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_license": { - "name": "source_license", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_conditions_obs_geom": { - "name": "idx_conditions_obs_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_conditions_obs_domain": { - "name": "idx_conditions_obs_domain", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_dom_type": { - "name": "idx_conditions_obs_dom_type", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_severity": { - "name": "idx_conditions_obs_severity", - "columns": [ - { - "expression": "severity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_metric": { - "name": "idx_conditions_obs_metric", - "columns": [ - { - "expression": "metric", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_valid_to": { - "name": "idx_conditions_obs_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_expires": { - "name": "idx_conditions_obs_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_subject": { - "name": "idx_conditions_obs_subject", - "columns": [ - { - "expression": "subject", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_source": { - "name": "idx_conditions_obs_source", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_canonical": { - "name": "idx_conditions_obs_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_content_hash": { - "name": "idx_conditions_obs_content_hash", - "columns": [ - { - "expression": "content_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_phenomenon": { - "name": "idx_conditions_obs_phenomenon", - "columns": [ - { - "expression": "phenomenon_fingerprint", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_instance": { - "name": "idx_conditions_obs_instance", - "columns": [ - { - "expression": "instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_privacy": { - "name": "idx_conditions_obs_privacy", - "columns": [ - { - "expression": "privacy_class", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_evidence_state": { - "name": "idx_conditions_obs_evidence_state", - "columns": [ - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_flagged": { - "name": "idx_conditions_obs_flagged", - "columns": [ - { - "expression": "flagged_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observations\".\"flagged_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_corroborations": { - "name": "idx_conditions_obs_corroborations", - "columns": [ - { - "expression": "corroborations", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_replaces": { - "name": "idx_conditions_obs_replaces", - "columns": [ - { - "expression": "replaces", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "obs_confidence_score_range": { - "name": "obs_confidence_score_range", - "value": "\"conditions\".\"observations\".\"confidence_score\" IS NULL OR (\"conditions\".\"observations\".\"confidence_score\" >= 0 AND \"conditions\".\"observations\".\"confidence_score\" <= 1)" - }, - "obs_dp_epsilon_nonneg": { - "name": "obs_dp_epsilon_nonneg", - "value": "\"conditions\".\"observations\".\"dp_epsilon\" IS NULL OR \"conditions\".\"observations\".\"dp_epsilon\" >= 0" - }, - "obs_dp_delta_range": { - "name": "obs_dp_delta_range", - "value": "\"conditions\".\"observations\".\"dp_delta\" IS NULL OR (\"conditions\".\"observations\".\"dp_delta\" >= 0 AND \"conditions\".\"observations\".\"dp_delta\" < 1)" - }, - "obs_k_anonymity_positive": { - "name": "obs_k_anonymity_positive", - "value": "\"conditions\".\"observations\".\"k_anonymity\" IS NULL OR \"conditions\".\"observations\".\"k_anonymity\" > 0" - }, - "obs_severity_level_range": { - "name": "obs_severity_level_range", - "value": "\"conditions\".\"observations\".\"severity_level\" IS NULL OR (\"conditions\".\"observations\".\"severity_level\" >= 1 AND \"conditions\".\"observations\".\"severity_level\" <= 5)" - }, - "obs_fuzziness_enum": { - "name": "obs_fuzziness_enum", - "value": "\"conditions\".\"observations\".\"fuzziness\" IN ('exact','low_res','medium_res','end_unknown','start_unknown','extent_unknown')" - }, - "obs_privacy_class_enum": { - "name": "obs_privacy_class_enum", - "value": "\"conditions\".\"observations\".\"privacy_class\" IN ('unknown','authoritative','aggregate','k_anon','dp_noised','crowd_pseudonym')" - }, - "obs_evidence_state_enum": { - "name": "obs_evidence_state_enum", - "value": "\"conditions\".\"observations\".\"evidence_state\" IS NULL OR \"conditions\".\"observations\".\"evidence_state\" IN ('self_reported','corroborated','externally_resolved','negated','expired')" - }, - "obs_tombstone_reason_enum": { - "name": "obs_tombstone_reason_enum", - "value": "\"conditions\".\"observations\".\"tombstone_reason\" IS NULL OR \"conditions\".\"observations\".\"tombstone_reason\" IN ('deleted_by_source','gdpr_erasure','retracted_as_wrong','expired','legal_takedown')" - } - }, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_observation": { - "name": "idx_report_evidence_observation", - "columns": [ - { - "expression": "observation_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"conditions\".\"report_evidence\".\"evidence_kind\" IN ('report','confirm','negate','official_match','reviewer_accept','reviewer_reject','expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "sensor_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_sample": { - "name": "sensor_speed_sample", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_sample_key_bucket": { - "name": "idx_sensor_sample_key_bucket", - "columns": [ - { - "expression": "sensor_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_hour", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sensor_sample_observed": { - "name": "idx_sensor_sample_observed", - "columns": [ - { - "expression": "observed_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_sensor_sample_key_observed": { - "name": "uq_sensor_sample_key_observed", - "nullsNotDistinct": false, - "columns": [ - "sensor_key", - "observed_at" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_subject": { - "name": "idx_sub_claim_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"conditions\".\"sub_claim\".\"claim_type\" IN ('confirm','negate','flag')" - } - }, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0023_snapshot.json b/packages/core/drizzle/meta/0023_snapshot.json deleted file mode 100644 index 62770dc5f..000000000 --- a/packages/core/drizzle/meta/0023_snapshot.json +++ /dev/null @@ -1,2455 +0,0 @@ -{ - "id": "36dd7009-841b-44c5-80d7-60b712e05993", - "prevId": "d78e8c0e-353c-4d80-a10d-989b86a724f8", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "object_id": { - "name": "object_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_snapshot": { - "name": "payload_snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_object": { - "name": "idx_federation_outbox_object", - "columns": [ - { - "expression": "object_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observations": { - "name": "observations", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_format": { - "name": "source_format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity_source": { - "name": "severity_source", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "headline": { - "name": "headline", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "metric": { - "name": "metric", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "level": { - "name": "level", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "aggregation": { - "name": "aggregation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "subject": { - "name": "subject", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "attributes": { - "name": "attributes", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "schedule": { - "name": "schedule", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_forecast": { - "name": "is_forecast", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "related_ids": { - "name": "related_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "origin": { - "name": "origin", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "data_updated_at": { - "name": "data_updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "is_stale": { - "name": "is_stale", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "stale_after": { - "name": "stale_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "phenomenon_fingerprint": { - "name": "phenomenon_fingerprint", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "replaces": { - "name": "replaces", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "fuzziness": { - "name": "fuzziness", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'exact'" - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'unknown'" - }, - "k_anonymity": { - "name": "k_anonymity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "dp_epsilon": { - "name": "dp_epsilon", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "dp_delta": { - "name": "dp_delta", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "informed": { - "name": "informed", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "source_uri": { - "name": "source_uri", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_license": { - "name": "source_license", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_conditions_obs_geom": { - "name": "idx_conditions_obs_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_conditions_obs_domain": { - "name": "idx_conditions_obs_domain", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_dom_type": { - "name": "idx_conditions_obs_dom_type", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_severity": { - "name": "idx_conditions_obs_severity", - "columns": [ - { - "expression": "severity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_metric": { - "name": "idx_conditions_obs_metric", - "columns": [ - { - "expression": "metric", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_valid_to": { - "name": "idx_conditions_obs_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_expires": { - "name": "idx_conditions_obs_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_subject": { - "name": "idx_conditions_obs_subject", - "columns": [ - { - "expression": "subject", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gin", - "concurrently": false - }, - "idx_conditions_obs_source": { - "name": "idx_conditions_obs_source", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_canonical": { - "name": "idx_conditions_obs_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_content_hash": { - "name": "idx_conditions_obs_content_hash", - "columns": [ - { - "expression": "content_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_phenomenon": { - "name": "idx_conditions_obs_phenomenon", - "columns": [ - { - "expression": "phenomenon_fingerprint", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_instance": { - "name": "idx_conditions_obs_instance", - "columns": [ - { - "expression": "instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_privacy": { - "name": "idx_conditions_obs_privacy", - "columns": [ - { - "expression": "privacy_class", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_evidence_state": { - "name": "idx_conditions_obs_evidence_state", - "columns": [ - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_flagged": { - "name": "idx_conditions_obs_flagged", - "columns": [ - { - "expression": "flagged_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"observations\".\"flagged_at\" IS NOT NULL", - "concurrently": false - }, - "idx_conditions_obs_corroborations": { - "name": "idx_conditions_obs_corroborations", - "columns": [ - { - "expression": "corroborations", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gin", - "concurrently": false - }, - "idx_conditions_obs_replaces": { - "name": "idx_conditions_obs_replaces", - "columns": [ - { - "expression": "replaces", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gin", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "obs_confidence_score_range": { - "name": "obs_confidence_score_range", - "value": "\"conditions\".\"observations\".\"confidence_score\" IS NULL OR (\"conditions\".\"observations\".\"confidence_score\" >= 0 AND \"conditions\".\"observations\".\"confidence_score\" <= 1)" - }, - "obs_dp_epsilon_nonneg": { - "name": "obs_dp_epsilon_nonneg", - "value": "\"conditions\".\"observations\".\"dp_epsilon\" IS NULL OR \"conditions\".\"observations\".\"dp_epsilon\" >= 0" - }, - "obs_dp_delta_range": { - "name": "obs_dp_delta_range", - "value": "\"conditions\".\"observations\".\"dp_delta\" IS NULL OR (\"conditions\".\"observations\".\"dp_delta\" >= 0 AND \"conditions\".\"observations\".\"dp_delta\" < 1)" - }, - "obs_k_anonymity_positive": { - "name": "obs_k_anonymity_positive", - "value": "\"conditions\".\"observations\".\"k_anonymity\" IS NULL OR \"conditions\".\"observations\".\"k_anonymity\" > 0" - }, - "obs_severity_level_range": { - "name": "obs_severity_level_range", - "value": "\"conditions\".\"observations\".\"severity_level\" IS NULL OR (\"conditions\".\"observations\".\"severity_level\" >= 1 AND \"conditions\".\"observations\".\"severity_level\" <= 5)" - }, - "obs_fuzziness_enum": { - "name": "obs_fuzziness_enum", - "value": "\"conditions\".\"observations\".\"fuzziness\" IN ('exact','low_res','medium_res','end_unknown','start_unknown','extent_unknown')" - }, - "obs_privacy_class_enum": { - "name": "obs_privacy_class_enum", - "value": "\"conditions\".\"observations\".\"privacy_class\" IN ('unknown','authoritative','aggregate','k_anon','dp_noised','crowd_pseudonym')" - }, - "obs_evidence_state_enum": { - "name": "obs_evidence_state_enum", - "value": "\"conditions\".\"observations\".\"evidence_state\" IS NULL OR \"conditions\".\"observations\".\"evidence_state\" IN ('self_reported','corroborated','externally_resolved','negated','expired')" - }, - "obs_tombstone_reason_enum": { - "name": "obs_tombstone_reason_enum", - "value": "\"conditions\".\"observations\".\"tombstone_reason\" IS NULL OR \"conditions\".\"observations\".\"tombstone_reason\" IN ('deleted_by_source','gdpr_erasure','retracted_as_wrong','expired','legal_takedown')" - } - }, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_observation": { - "name": "idx_report_evidence_observation", - "columns": [ - { - "expression": "observation_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"conditions\".\"report_evidence\".\"evidence_kind\" IN ('report','confirm','negate','official_match','reviewer_accept','reviewer_reject','expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "sensor_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_sample": { - "name": "sensor_speed_sample", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_sample_key_bucket": { - "name": "idx_sensor_sample_key_bucket", - "columns": [ - { - "expression": "sensor_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_hour", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_sensor_sample_observed": { - "name": "idx_sensor_sample_observed", - "columns": [ - { - "expression": "observed_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_sensor_sample_key_observed": { - "name": "uq_sensor_sample_key_observed", - "columns": [ - "sensor_key", - "observed_at" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_sub_claim_subject": { - "name": "idx_sub_claim_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"conditions\".\"sub_claim\".\"claim_type\" IN ('confirm','negate','flag')" - } - }, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "views": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0024_snapshot.json b/packages/core/drizzle/meta/0024_snapshot.json deleted file mode 100644 index d6a2768e3..000000000 --- a/packages/core/drizzle/meta/0024_snapshot.json +++ /dev/null @@ -1,2534 +0,0 @@ -{ - "id": "22c1f098-cb91-46f1-8c35-a97c921a3359", - "prevId": "36dd7009-841b-44c5-80d7-60b712e05993", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "object_id": { - "name": "object_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_snapshot": { - "name": "payload_snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_object": { - "name": "idx_federation_outbox_object", - "columns": [ - { - "expression": "object_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observations": { - "name": "observations", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_format": { - "name": "source_format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity_source": { - "name": "severity_source", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "headline": { - "name": "headline", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "metric": { - "name": "metric", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "level": { - "name": "level", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "aggregation": { - "name": "aggregation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "subject": { - "name": "subject", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "attributes": { - "name": "attributes", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "schedule": { - "name": "schedule", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_forecast": { - "name": "is_forecast", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "related_ids": { - "name": "related_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "origin": { - "name": "origin", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "data_updated_at": { - "name": "data_updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "is_stale": { - "name": "is_stale", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "stale_after": { - "name": "stale_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "phenomenon_fingerprint": { - "name": "phenomenon_fingerprint", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "replaces": { - "name": "replaces", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "fuzziness": { - "name": "fuzziness", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'exact'" - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'unknown'" - }, - "k_anonymity": { - "name": "k_anonymity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "dp_epsilon": { - "name": "dp_epsilon", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "dp_delta": { - "name": "dp_delta", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "informed": { - "name": "informed", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "source_uri": { - "name": "source_uri", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_license": { - "name": "source_license", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_conditions_obs_geom": { - "name": "idx_conditions_obs_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_conditions_obs_domain": { - "name": "idx_conditions_obs_domain", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_dom_type": { - "name": "idx_conditions_obs_dom_type", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_severity": { - "name": "idx_conditions_obs_severity", - "columns": [ - { - "expression": "severity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_metric": { - "name": "idx_conditions_obs_metric", - "columns": [ - { - "expression": "metric", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_valid_to": { - "name": "idx_conditions_obs_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_expires": { - "name": "idx_conditions_obs_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_subject": { - "name": "idx_conditions_obs_subject", - "columns": [ - { - "expression": "subject", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_source": { - "name": "idx_conditions_obs_source", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_canonical": { - "name": "idx_conditions_obs_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_content_hash": { - "name": "idx_conditions_obs_content_hash", - "columns": [ - { - "expression": "content_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_phenomenon": { - "name": "idx_conditions_obs_phenomenon", - "columns": [ - { - "expression": "phenomenon_fingerprint", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_instance": { - "name": "idx_conditions_obs_instance", - "columns": [ - { - "expression": "instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_privacy": { - "name": "idx_conditions_obs_privacy", - "columns": [ - { - "expression": "privacy_class", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_evidence_state": { - "name": "idx_conditions_obs_evidence_state", - "columns": [ - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_flagged": { - "name": "idx_conditions_obs_flagged", - "columns": [ - { - "expression": "flagged_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observations\".\"flagged_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_corroborations": { - "name": "idx_conditions_obs_corroborations", - "columns": [ - { - "expression": "corroborations", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_replaces": { - "name": "idx_conditions_obs_replaces", - "columns": [ - { - "expression": "replaces", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "obs_confidence_score_range": { - "name": "obs_confidence_score_range", - "value": "\"conditions\".\"observations\".\"confidence_score\" IS NULL OR (\"conditions\".\"observations\".\"confidence_score\" >= 0 AND \"conditions\".\"observations\".\"confidence_score\" <= 1)" - }, - "obs_dp_epsilon_nonneg": { - "name": "obs_dp_epsilon_nonneg", - "value": "\"conditions\".\"observations\".\"dp_epsilon\" IS NULL OR \"conditions\".\"observations\".\"dp_epsilon\" >= 0" - }, - "obs_dp_delta_range": { - "name": "obs_dp_delta_range", - "value": "\"conditions\".\"observations\".\"dp_delta\" IS NULL OR (\"conditions\".\"observations\".\"dp_delta\" >= 0 AND \"conditions\".\"observations\".\"dp_delta\" < 1)" - }, - "obs_k_anonymity_positive": { - "name": "obs_k_anonymity_positive", - "value": "\"conditions\".\"observations\".\"k_anonymity\" IS NULL OR \"conditions\".\"observations\".\"k_anonymity\" > 0" - }, - "obs_severity_level_range": { - "name": "obs_severity_level_range", - "value": "\"conditions\".\"observations\".\"severity_level\" IS NULL OR (\"conditions\".\"observations\".\"severity_level\" >= 1 AND \"conditions\".\"observations\".\"severity_level\" <= 5)" - }, - "obs_fuzziness_enum": { - "name": "obs_fuzziness_enum", - "value": "\"conditions\".\"observations\".\"fuzziness\" IN ('exact','low_res','medium_res','end_unknown','start_unknown','extent_unknown')" - }, - "obs_privacy_class_enum": { - "name": "obs_privacy_class_enum", - "value": "\"conditions\".\"observations\".\"privacy_class\" IN ('unknown','authoritative','aggregate','k_anon','dp_noised','crowd_pseudonym')" - }, - "obs_evidence_state_enum": { - "name": "obs_evidence_state_enum", - "value": "\"conditions\".\"observations\".\"evidence_state\" IS NULL OR \"conditions\".\"observations\".\"evidence_state\" IN ('self_reported','corroborated','externally_resolved','negated','expired')" - }, - "obs_tombstone_reason_enum": { - "name": "obs_tombstone_reason_enum", - "value": "\"conditions\".\"observations\".\"tombstone_reason\" IS NULL OR \"conditions\".\"observations\".\"tombstone_reason\" IN ('deleted_by_source','gdpr_erasure','retracted_as_wrong','expired','legal_takedown')" - } - }, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_observation": { - "name": "idx_report_evidence_observation", - "columns": [ - { - "expression": "observation_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"conditions\".\"report_evidence\".\"evidence_kind\" IN ('report','confirm','negate','official_match','reviewer_accept','reviewer_reject','expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "sensor_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_hourly": { - "name": "sensor_speed_hourly", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "speed_bins": { - "name": "speed_bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": true - }, - "speed_counts": { - "name": "speed_counts", - "type": "integer[]", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_hourly_hour": { - "name": "idx_sensor_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_speed_hourly_sensor_key_hour_utc_pk": { - "name": "sensor_speed_hourly_sensor_key_hour_utc_pk", - "columns": [ - "sensor_key", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_sample": { - "name": "sensor_speed_sample", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_sample_key_bucket": { - "name": "idx_sensor_sample_key_bucket", - "columns": [ - { - "expression": "sensor_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_hour", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sensor_sample_observed": { - "name": "idx_sensor_sample_observed", - "columns": [ - { - "expression": "observed_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_sensor_sample_key_observed": { - "name": "uq_sensor_sample_key_observed", - "nullsNotDistinct": false, - "columns": [ - "sensor_key", - "observed_at" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_subject": { - "name": "idx_sub_claim_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"conditions\".\"sub_claim\".\"claim_type\" IN ('confirm','negate','flag')" - } - }, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0025_snapshot.json b/packages/core/drizzle/meta/0025_snapshot.json deleted file mode 100644 index 5e6defdcd..000000000 --- a/packages/core/drizzle/meta/0025_snapshot.json +++ /dev/null @@ -1,2734 +0,0 @@ -{ - "id": "d29d82ae-433c-4158-b1ef-cc5116934989", - "prevId": "22c1f098-cb91-46f1-8c35-a97c921a3359", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "object_id": { - "name": "object_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_snapshot": { - "name": "payload_snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_object": { - "name": "idx_federation_outbox_object", - "columns": [ - { - "expression": "object_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_binding": { - "name": "observation_binding", - "schema": "conditions", - "columns": { - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'single'" - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_binding_status": { - "name": "idx_observation_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_binding_observation_id_observations_id_fk": { - "name": "observation_binding_observation_id_observations_id_fk", - "tableFrom": "observation_binding", - "tableTo": "observations", - "schemaTo": "conditions", - "columnsFrom": [ - "observation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_segment": { - "name": "observation_segment", - "schema": "conditions", - "columns": { - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_segment_segment": { - "name": "idx_observation_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_segment_observation_id_observations_id_fk": { - "name": "observation_segment_observation_id_observations_id_fk", - "tableFrom": "observation_segment", - "tableTo": "observations", - "schemaTo": "conditions", - "columnsFrom": [ - "observation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_segment_observation_id_seq_pk": { - "name": "observation_segment_observation_id_seq_pk", - "columns": [ - "observation_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observations": { - "name": "observations", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_format": { - "name": "source_format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity_source": { - "name": "severity_source", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "headline": { - "name": "headline", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "metric": { - "name": "metric", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "level": { - "name": "level", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "aggregation": { - "name": "aggregation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "subject": { - "name": "subject", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "attributes": { - "name": "attributes", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "schedule": { - "name": "schedule", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_forecast": { - "name": "is_forecast", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "related_ids": { - "name": "related_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "origin": { - "name": "origin", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "data_updated_at": { - "name": "data_updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "is_stale": { - "name": "is_stale", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "stale_after": { - "name": "stale_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "phenomenon_fingerprint": { - "name": "phenomenon_fingerprint", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "replaces": { - "name": "replaces", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "fuzziness": { - "name": "fuzziness", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'exact'" - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'unknown'" - }, - "k_anonymity": { - "name": "k_anonymity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "dp_epsilon": { - "name": "dp_epsilon", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "dp_delta": { - "name": "dp_delta", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "informed": { - "name": "informed", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "source_uri": { - "name": "source_uri", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_license": { - "name": "source_license", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_conditions_obs_geom": { - "name": "idx_conditions_obs_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_conditions_obs_domain": { - "name": "idx_conditions_obs_domain", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_dom_type": { - "name": "idx_conditions_obs_dom_type", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_severity": { - "name": "idx_conditions_obs_severity", - "columns": [ - { - "expression": "severity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_metric": { - "name": "idx_conditions_obs_metric", - "columns": [ - { - "expression": "metric", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_valid_to": { - "name": "idx_conditions_obs_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_expires": { - "name": "idx_conditions_obs_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_subject": { - "name": "idx_conditions_obs_subject", - "columns": [ - { - "expression": "subject", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_source": { - "name": "idx_conditions_obs_source", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_canonical": { - "name": "idx_conditions_obs_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_content_hash": { - "name": "idx_conditions_obs_content_hash", - "columns": [ - { - "expression": "content_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_phenomenon": { - "name": "idx_conditions_obs_phenomenon", - "columns": [ - { - "expression": "phenomenon_fingerprint", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_instance": { - "name": "idx_conditions_obs_instance", - "columns": [ - { - "expression": "instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_privacy": { - "name": "idx_conditions_obs_privacy", - "columns": [ - { - "expression": "privacy_class", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_evidence_state": { - "name": "idx_conditions_obs_evidence_state", - "columns": [ - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_flagged": { - "name": "idx_conditions_obs_flagged", - "columns": [ - { - "expression": "flagged_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observations\".\"flagged_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_corroborations": { - "name": "idx_conditions_obs_corroborations", - "columns": [ - { - "expression": "corroborations", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_replaces": { - "name": "idx_conditions_obs_replaces", - "columns": [ - { - "expression": "replaces", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "obs_confidence_score_range": { - "name": "obs_confidence_score_range", - "value": "\"conditions\".\"observations\".\"confidence_score\" IS NULL OR (\"conditions\".\"observations\".\"confidence_score\" >= 0 AND \"conditions\".\"observations\".\"confidence_score\" <= 1)" - }, - "obs_dp_epsilon_nonneg": { - "name": "obs_dp_epsilon_nonneg", - "value": "\"conditions\".\"observations\".\"dp_epsilon\" IS NULL OR \"conditions\".\"observations\".\"dp_epsilon\" >= 0" - }, - "obs_dp_delta_range": { - "name": "obs_dp_delta_range", - "value": "\"conditions\".\"observations\".\"dp_delta\" IS NULL OR (\"conditions\".\"observations\".\"dp_delta\" >= 0 AND \"conditions\".\"observations\".\"dp_delta\" < 1)" - }, - "obs_k_anonymity_positive": { - "name": "obs_k_anonymity_positive", - "value": "\"conditions\".\"observations\".\"k_anonymity\" IS NULL OR \"conditions\".\"observations\".\"k_anonymity\" > 0" - }, - "obs_severity_level_range": { - "name": "obs_severity_level_range", - "value": "\"conditions\".\"observations\".\"severity_level\" IS NULL OR (\"conditions\".\"observations\".\"severity_level\" >= 1 AND \"conditions\".\"observations\".\"severity_level\" <= 5)" - }, - "obs_fuzziness_enum": { - "name": "obs_fuzziness_enum", - "value": "\"conditions\".\"observations\".\"fuzziness\" IN ('exact','low_res','medium_res','end_unknown','start_unknown','extent_unknown')" - }, - "obs_privacy_class_enum": { - "name": "obs_privacy_class_enum", - "value": "\"conditions\".\"observations\".\"privacy_class\" IN ('unknown','authoritative','aggregate','k_anon','dp_noised','crowd_pseudonym')" - }, - "obs_evidence_state_enum": { - "name": "obs_evidence_state_enum", - "value": "\"conditions\".\"observations\".\"evidence_state\" IS NULL OR \"conditions\".\"observations\".\"evidence_state\" IN ('self_reported','corroborated','externally_resolved','negated','expired')" - }, - "obs_tombstone_reason_enum": { - "name": "obs_tombstone_reason_enum", - "value": "\"conditions\".\"observations\".\"tombstone_reason\" IS NULL OR \"conditions\".\"observations\".\"tombstone_reason\" IN ('deleted_by_source','gdpr_erasure','retracted_as_wrong','expired','legal_takedown')" - } - }, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_observation": { - "name": "idx_report_evidence_observation", - "columns": [ - { - "expression": "observation_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"conditions\".\"report_evidence\".\"evidence_kind\" IN ('report','confirm','negate','official_match','reviewer_accept','reviewer_reject','expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "sensor_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_hourly": { - "name": "sensor_speed_hourly", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "speed_bins": { - "name": "speed_bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": true - }, - "speed_counts": { - "name": "speed_counts", - "type": "integer[]", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_hourly_hour": { - "name": "idx_sensor_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_speed_hourly_sensor_key_hour_utc_pk": { - "name": "sensor_speed_hourly_sensor_key_hour_utc_pk", - "columns": [ - "sensor_key", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_sample": { - "name": "sensor_speed_sample", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_sample_key_bucket": { - "name": "idx_sensor_sample_key_bucket", - "columns": [ - { - "expression": "sensor_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_hour", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sensor_sample_observed": { - "name": "idx_sensor_sample_observed", - "columns": [ - { - "expression": "observed_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_sensor_sample_key_observed": { - "name": "uq_sensor_sample_key_observed", - "nullsNotDistinct": false, - "columns": [ - "sensor_key", - "observed_at" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_subject": { - "name": "idx_sub_claim_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"conditions\".\"sub_claim\".\"claim_type\" IN ('confirm','negate','flag')" - } - }, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0026_snapshot.json b/packages/core/drizzle/meta/0026_snapshot.json deleted file mode 100644 index cd12b88d8..000000000 --- a/packages/core/drizzle/meta/0026_snapshot.json +++ /dev/null @@ -1,2952 +0,0 @@ -{ - "id": "957e4325-bf8b-4a72-a88e-90a9f3fd95c8", - "prevId": "d29d82ae-433c-4158-b1ef-cc5116934989", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "object_id": { - "name": "object_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_snapshot": { - "name": "payload_snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_object": { - "name": "idx_federation_outbox_object", - "columns": [ - { - "expression": "object_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_binding": { - "name": "observation_binding", - "schema": "conditions", - "columns": { - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'single'" - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_binding_status": { - "name": "idx_observation_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_binding_observation_id_observations_id_fk": { - "name": "observation_binding_observation_id_observations_id_fk", - "tableFrom": "observation_binding", - "tableTo": "observations", - "schemaTo": "conditions", - "columnsFrom": [ - "observation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_segment": { - "name": "observation_segment", - "schema": "conditions", - "columns": { - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_segment_segment": { - "name": "idx_observation_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_segment_observation_id_observations_id_fk": { - "name": "observation_segment_observation_id_observations_id_fk", - "tableFrom": "observation_segment", - "tableTo": "observations", - "schemaTo": "conditions", - "columnsFrom": [ - "observation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_segment_observation_id_seq_pk": { - "name": "observation_segment_observation_id_seq_pk", - "columns": [ - "observation_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observations": { - "name": "observations", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_format": { - "name": "source_format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity_source": { - "name": "severity_source", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "headline": { - "name": "headline", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "metric": { - "name": "metric", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "level": { - "name": "level", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "aggregation": { - "name": "aggregation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "subject": { - "name": "subject", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "attributes": { - "name": "attributes", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "schedule": { - "name": "schedule", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_forecast": { - "name": "is_forecast", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "related_ids": { - "name": "related_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "origin": { - "name": "origin", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "data_updated_at": { - "name": "data_updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "is_stale": { - "name": "is_stale", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "stale_after": { - "name": "stale_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "phenomenon_fingerprint": { - "name": "phenomenon_fingerprint", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "replaces": { - "name": "replaces", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "fuzziness": { - "name": "fuzziness", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'exact'" - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'unknown'" - }, - "k_anonymity": { - "name": "k_anonymity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "dp_epsilon": { - "name": "dp_epsilon", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "dp_delta": { - "name": "dp_delta", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "informed": { - "name": "informed", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "source_uri": { - "name": "source_uri", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_license": { - "name": "source_license", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_conditions_obs_geom": { - "name": "idx_conditions_obs_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_conditions_obs_domain": { - "name": "idx_conditions_obs_domain", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_dom_type": { - "name": "idx_conditions_obs_dom_type", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_severity": { - "name": "idx_conditions_obs_severity", - "columns": [ - { - "expression": "severity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_metric": { - "name": "idx_conditions_obs_metric", - "columns": [ - { - "expression": "metric", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_valid_to": { - "name": "idx_conditions_obs_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_expires": { - "name": "idx_conditions_obs_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_subject": { - "name": "idx_conditions_obs_subject", - "columns": [ - { - "expression": "subject", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_source": { - "name": "idx_conditions_obs_source", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_canonical": { - "name": "idx_conditions_obs_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_content_hash": { - "name": "idx_conditions_obs_content_hash", - "columns": [ - { - "expression": "content_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_phenomenon": { - "name": "idx_conditions_obs_phenomenon", - "columns": [ - { - "expression": "phenomenon_fingerprint", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_instance": { - "name": "idx_conditions_obs_instance", - "columns": [ - { - "expression": "instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_privacy": { - "name": "idx_conditions_obs_privacy", - "columns": [ - { - "expression": "privacy_class", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_evidence_state": { - "name": "idx_conditions_obs_evidence_state", - "columns": [ - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_flagged": { - "name": "idx_conditions_obs_flagged", - "columns": [ - { - "expression": "flagged_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observations\".\"flagged_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_corroborations": { - "name": "idx_conditions_obs_corroborations", - "columns": [ - { - "expression": "corroborations", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_replaces": { - "name": "idx_conditions_obs_replaces", - "columns": [ - { - "expression": "replaces", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "obs_confidence_score_range": { - "name": "obs_confidence_score_range", - "value": "\"conditions\".\"observations\".\"confidence_score\" IS NULL OR (\"conditions\".\"observations\".\"confidence_score\" >= 0 AND \"conditions\".\"observations\".\"confidence_score\" <= 1)" - }, - "obs_dp_epsilon_nonneg": { - "name": "obs_dp_epsilon_nonneg", - "value": "\"conditions\".\"observations\".\"dp_epsilon\" IS NULL OR \"conditions\".\"observations\".\"dp_epsilon\" >= 0" - }, - "obs_dp_delta_range": { - "name": "obs_dp_delta_range", - "value": "\"conditions\".\"observations\".\"dp_delta\" IS NULL OR (\"conditions\".\"observations\".\"dp_delta\" >= 0 AND \"conditions\".\"observations\".\"dp_delta\" < 1)" - }, - "obs_k_anonymity_positive": { - "name": "obs_k_anonymity_positive", - "value": "\"conditions\".\"observations\".\"k_anonymity\" IS NULL OR \"conditions\".\"observations\".\"k_anonymity\" > 0" - }, - "obs_severity_level_range": { - "name": "obs_severity_level_range", - "value": "\"conditions\".\"observations\".\"severity_level\" IS NULL OR (\"conditions\".\"observations\".\"severity_level\" >= 1 AND \"conditions\".\"observations\".\"severity_level\" <= 5)" - }, - "obs_fuzziness_enum": { - "name": "obs_fuzziness_enum", - "value": "\"conditions\".\"observations\".\"fuzziness\" IN ('exact','low_res','medium_res','end_unknown','start_unknown','extent_unknown')" - }, - "obs_privacy_class_enum": { - "name": "obs_privacy_class_enum", - "value": "\"conditions\".\"observations\".\"privacy_class\" IN ('unknown','authoritative','aggregate','k_anon','dp_noised','crowd_pseudonym')" - }, - "obs_evidence_state_enum": { - "name": "obs_evidence_state_enum", - "value": "\"conditions\".\"observations\".\"evidence_state\" IS NULL OR \"conditions\".\"observations\".\"evidence_state\" IN ('self_reported','corroborated','externally_resolved','negated','expired')" - }, - "obs_tombstone_reason_enum": { - "name": "obs_tombstone_reason_enum", - "value": "\"conditions\".\"observations\".\"tombstone_reason\" IS NULL OR \"conditions\".\"observations\".\"tombstone_reason\" IN ('deleted_by_source','gdpr_erasure','retracted_as_wrong','expired','legal_takedown')" - } - }, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_observation": { - "name": "idx_report_evidence_observation", - "columns": [ - { - "expression": "observation_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"conditions\".\"report_evidence\".\"evidence_kind\" IN ('report','confirm','negate','official_match','reviewer_accept','reviewer_reject','expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "sensor_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_hourly": { - "name": "sensor_speed_hourly", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "speed_bins": { - "name": "speed_bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": true - }, - "speed_counts": { - "name": "speed_counts", - "type": "integer[]", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_hourly_hour": { - "name": "idx_sensor_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_speed_hourly_sensor_key_hour_utc_pk": { - "name": "sensor_speed_hourly_sensor_key_hour_utc_pk", - "columns": [ - "sensor_key", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_sample": { - "name": "sensor_speed_sample", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_sample_key_bucket": { - "name": "idx_sensor_sample_key_bucket", - "columns": [ - { - "expression": "sensor_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_hour", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sensor_sample_observed": { - "name": "idx_sensor_sample_observed", - "columns": [ - { - "expression": "observed_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_sensor_sample_key_observed": { - "name": "uq_sensor_sample_key_observed", - "nullsNotDistinct": false, - "columns": [ - "sensor_key", - "observed_at" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_subject": { - "name": "idx_sub_claim_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"conditions\".\"sub_claim\".\"claim_type\" IN ('confirm','negate','flag')" - } - }, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0027_snapshot.json b/packages/core/drizzle/meta/0027_snapshot.json deleted file mode 100644 index 3f64f4bd8..000000000 --- a/packages/core/drizzle/meta/0027_snapshot.json +++ /dev/null @@ -1,3127 +0,0 @@ -{ - "id": "ce4f5781-cc89-415c-9ba1-99eeeba90718", - "prevId": "957e4325-bf8b-4a72-a88e-90a9f3fd95c8", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "observation_revision": { - "name": "observation_revision", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "binding_queue_observation_id_observations_id_fk": { - "name": "binding_queue_observation_id_observations_id_fk", - "tableFrom": "binding_queue", - "tableTo": "observations", - "schemaTo": "conditions", - "columnsFrom": [ - "observation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "object_id": { - "name": "object_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_snapshot": { - "name": "payload_snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_object": { - "name": "idx_federation_outbox_object", - "columns": [ - { - "expression": "object_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_binding": { - "name": "observation_binding", - "schema": "conditions", - "columns": { - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'single'" - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observation_revision": { - "name": "observation_revision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_binding_status": { - "name": "idx_observation_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_binding_observation_id_observations_id_fk": { - "name": "observation_binding_observation_id_observations_id_fk", - "tableFrom": "observation_binding", - "tableTo": "observations", - "schemaTo": "conditions", - "columnsFrom": [ - "observation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_segment": { - "name": "observation_segment", - "schema": "conditions", - "columns": { - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_segment_segment": { - "name": "idx_observation_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_segment_observation_id_observations_id_fk": { - "name": "observation_segment_observation_id_observations_id_fk", - "tableFrom": "observation_segment", - "tableTo": "observations", - "schemaTo": "conditions", - "columnsFrom": [ - "observation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_segment_observation_id_seq_pk": { - "name": "observation_segment_observation_id_seq_pk", - "columns": [ - "observation_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observations": { - "name": "observations", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_format": { - "name": "source_format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity_source": { - "name": "severity_source", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "headline": { - "name": "headline", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "metric": { - "name": "metric", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "level": { - "name": "level", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "aggregation": { - "name": "aggregation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "subject": { - "name": "subject", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "attributes": { - "name": "attributes", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "schedule": { - "name": "schedule", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_forecast": { - "name": "is_forecast", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "related_ids": { - "name": "related_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "origin": { - "name": "origin", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "data_updated_at": { - "name": "data_updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "is_stale": { - "name": "is_stale", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "stale_after": { - "name": "stale_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "phenomenon_fingerprint": { - "name": "phenomenon_fingerprint", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "replaces": { - "name": "replaces", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "fuzziness": { - "name": "fuzziness", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'exact'" - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'unknown'" - }, - "k_anonymity": { - "name": "k_anonymity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "dp_epsilon": { - "name": "dp_epsilon", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "dp_delta": { - "name": "dp_delta", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "informed": { - "name": "informed", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "source_uri": { - "name": "source_uri", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_license": { - "name": "source_license", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_conditions_obs_geom": { - "name": "idx_conditions_obs_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_conditions_obs_domain": { - "name": "idx_conditions_obs_domain", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_dom_type": { - "name": "idx_conditions_obs_dom_type", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_severity": { - "name": "idx_conditions_obs_severity", - "columns": [ - { - "expression": "severity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_metric": { - "name": "idx_conditions_obs_metric", - "columns": [ - { - "expression": "metric", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_valid_to": { - "name": "idx_conditions_obs_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_expires": { - "name": "idx_conditions_obs_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_subject": { - "name": "idx_conditions_obs_subject", - "columns": [ - { - "expression": "subject", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_source": { - "name": "idx_conditions_obs_source", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_canonical": { - "name": "idx_conditions_obs_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_content_hash": { - "name": "idx_conditions_obs_content_hash", - "columns": [ - { - "expression": "content_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_phenomenon": { - "name": "idx_conditions_obs_phenomenon", - "columns": [ - { - "expression": "phenomenon_fingerprint", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_instance": { - "name": "idx_conditions_obs_instance", - "columns": [ - { - "expression": "instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_privacy": { - "name": "idx_conditions_obs_privacy", - "columns": [ - { - "expression": "privacy_class", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_evidence_state": { - "name": "idx_conditions_obs_evidence_state", - "columns": [ - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_flagged": { - "name": "idx_conditions_obs_flagged", - "columns": [ - { - "expression": "flagged_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observations\".\"flagged_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_corroborations": { - "name": "idx_conditions_obs_corroborations", - "columns": [ - { - "expression": "corroborations", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_replaces": { - "name": "idx_conditions_obs_replaces", - "columns": [ - { - "expression": "replaces", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "obs_confidence_score_range": { - "name": "obs_confidence_score_range", - "value": "\"conditions\".\"observations\".\"confidence_score\" IS NULL OR (\"conditions\".\"observations\".\"confidence_score\" >= 0 AND \"conditions\".\"observations\".\"confidence_score\" <= 1)" - }, - "obs_dp_epsilon_nonneg": { - "name": "obs_dp_epsilon_nonneg", - "value": "\"conditions\".\"observations\".\"dp_epsilon\" IS NULL OR \"conditions\".\"observations\".\"dp_epsilon\" >= 0" - }, - "obs_dp_delta_range": { - "name": "obs_dp_delta_range", - "value": "\"conditions\".\"observations\".\"dp_delta\" IS NULL OR (\"conditions\".\"observations\".\"dp_delta\" >= 0 AND \"conditions\".\"observations\".\"dp_delta\" < 1)" - }, - "obs_k_anonymity_positive": { - "name": "obs_k_anonymity_positive", - "value": "\"conditions\".\"observations\".\"k_anonymity\" IS NULL OR \"conditions\".\"observations\".\"k_anonymity\" > 0" - }, - "obs_severity_level_range": { - "name": "obs_severity_level_range", - "value": "\"conditions\".\"observations\".\"severity_level\" IS NULL OR (\"conditions\".\"observations\".\"severity_level\" >= 1 AND \"conditions\".\"observations\".\"severity_level\" <= 5)" - }, - "obs_fuzziness_enum": { - "name": "obs_fuzziness_enum", - "value": "\"conditions\".\"observations\".\"fuzziness\" IN ('exact','low_res','medium_res','end_unknown','start_unknown','extent_unknown')" - }, - "obs_privacy_class_enum": { - "name": "obs_privacy_class_enum", - "value": "\"conditions\".\"observations\".\"privacy_class\" IN ('unknown','authoritative','aggregate','k_anon','dp_noised','crowd_pseudonym')" - }, - "obs_evidence_state_enum": { - "name": "obs_evidence_state_enum", - "value": "\"conditions\".\"observations\".\"evidence_state\" IS NULL OR \"conditions\".\"observations\".\"evidence_state\" IN ('self_reported','corroborated','externally_resolved','negated','expired')" - }, - "obs_tombstone_reason_enum": { - "name": "obs_tombstone_reason_enum", - "value": "\"conditions\".\"observations\".\"tombstone_reason\" IS NULL OR \"conditions\".\"observations\".\"tombstone_reason\" IN ('deleted_by_source','gdpr_erasure','retracted_as_wrong','expired','legal_takedown')" - } - }, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_observation": { - "name": "idx_report_evidence_observation", - "columns": [ - { - "expression": "observation_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"conditions\".\"report_evidence\".\"evidence_kind\" IN ('report','confirm','negate','official_match','reviewer_accept','reviewer_reject','expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "sensor_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_hourly": { - "name": "sensor_speed_hourly", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "speed_bins": { - "name": "speed_bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": true - }, - "speed_counts": { - "name": "speed_counts", - "type": "integer[]", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_hourly_hour": { - "name": "idx_sensor_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_speed_hourly_sensor_key_hour_utc_pk": { - "name": "sensor_speed_hourly_sensor_key_hour_utc_pk", - "columns": [ - "sensor_key", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_sample": { - "name": "sensor_speed_sample", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_sample_key_bucket": { - "name": "idx_sensor_sample_key_bucket", - "columns": [ - { - "expression": "sensor_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_hour", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sensor_sample_observed": { - "name": "idx_sensor_sample_observed", - "columns": [ - { - "expression": "observed_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_sensor_sample_key_observed": { - "name": "uq_sensor_sample_key_observed", - "nullsNotDistinct": false, - "columns": [ - "sensor_key", - "observed_at" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_subject": { - "name": "idx_sub_claim_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"conditions\".\"sub_claim\".\"claim_type\" IN ('confirm','negate','flag')" - } - }, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} diff --git a/packages/core/drizzle/meta/0028_snapshot.json b/packages/core/drizzle/meta/0028_snapshot.json deleted file mode 100644 index 22b774a0c..000000000 --- a/packages/core/drizzle/meta/0028_snapshot.json +++ /dev/null @@ -1,3127 +0,0 @@ -{ - "id": "0d0152b2-b3a3-4354-a0f0-73a93249fc47", - "prevId": "ce4f5781-cc89-415c-9ba1-99eeeba90718", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "observation_revision": { - "name": "observation_revision", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "binding_queue_observation_id_observations_id_fk": { - "name": "binding_queue_observation_id_observations_id_fk", - "tableFrom": "binding_queue", - "columnsFrom": [ - "observation_id" - ], - "tableTo": "observations", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "object_id": { - "name": "object_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_snapshot": { - "name": "payload_snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_object": { - "name": "idx_federation_outbox_object", - "columns": [ - { - "expression": "object_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_binding": { - "name": "observation_binding", - "schema": "conditions", - "columns": { - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'single'" - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observation_revision": { - "name": "observation_revision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_binding_status": { - "name": "idx_observation_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "observation_binding_observation_id_observations_id_fk": { - "name": "observation_binding_observation_id_observations_id_fk", - "tableFrom": "observation_binding", - "columnsFrom": [ - "observation_id" - ], - "tableTo": "observations", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_segment": { - "name": "observation_segment", - "schema": "conditions", - "columns": { - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_segment_segment": { - "name": "idx_observation_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "observation_segment_observation_id_observations_id_fk": { - "name": "observation_segment_observation_id_observations_id_fk", - "tableFrom": "observation_segment", - "columnsFrom": [ - "observation_id" - ], - "tableTo": "observations", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "observation_segment_observation_id_seq_pk": { - "name": "observation_segment_observation_id_seq_pk", - "columns": [ - "observation_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observations": { - "name": "observations", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_format": { - "name": "source_format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity_source": { - "name": "severity_source", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "headline": { - "name": "headline", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "metric": { - "name": "metric", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "level": { - "name": "level", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "aggregation": { - "name": "aggregation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "subject": { - "name": "subject", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "attributes": { - "name": "attributes", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "schedule": { - "name": "schedule", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_forecast": { - "name": "is_forecast", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "related_ids": { - "name": "related_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "origin": { - "name": "origin", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "data_updated_at": { - "name": "data_updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "is_stale": { - "name": "is_stale", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "stale_after": { - "name": "stale_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "phenomenon_fingerprint": { - "name": "phenomenon_fingerprint", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "replaces": { - "name": "replaces", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "fuzziness": { - "name": "fuzziness", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'exact'" - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'unknown'" - }, - "k_anonymity": { - "name": "k_anonymity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "dp_epsilon": { - "name": "dp_epsilon", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "dp_delta": { - "name": "dp_delta", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "informed": { - "name": "informed", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "source_uri": { - "name": "source_uri", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_license": { - "name": "source_license", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_conditions_obs_geom": { - "name": "idx_conditions_obs_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_conditions_obs_domain": { - "name": "idx_conditions_obs_domain", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_dom_type": { - "name": "idx_conditions_obs_dom_type", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_severity": { - "name": "idx_conditions_obs_severity", - "columns": [ - { - "expression": "severity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_metric": { - "name": "idx_conditions_obs_metric", - "columns": [ - { - "expression": "metric", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_valid_to": { - "name": "idx_conditions_obs_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_expires": { - "name": "idx_conditions_obs_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_subject": { - "name": "idx_conditions_obs_subject", - "columns": [ - { - "expression": "subject", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gin", - "concurrently": false - }, - "idx_conditions_obs_source": { - "name": "idx_conditions_obs_source", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_canonical": { - "name": "idx_conditions_obs_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_content_hash": { - "name": "idx_conditions_obs_content_hash", - "columns": [ - { - "expression": "content_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_phenomenon": { - "name": "idx_conditions_obs_phenomenon", - "columns": [ - { - "expression": "phenomenon_fingerprint", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_instance": { - "name": "idx_conditions_obs_instance", - "columns": [ - { - "expression": "instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_privacy": { - "name": "idx_conditions_obs_privacy", - "columns": [ - { - "expression": "privacy_class", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_evidence_state": { - "name": "idx_conditions_obs_evidence_state", - "columns": [ - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_flagged": { - "name": "idx_conditions_obs_flagged", - "columns": [ - { - "expression": "flagged_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"observations\".\"flagged_at\" IS NOT NULL", - "concurrently": false - }, - "idx_conditions_obs_corroborations": { - "name": "idx_conditions_obs_corroborations", - "columns": [ - { - "expression": "corroborations", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gin", - "concurrently": false - }, - "idx_conditions_obs_replaces": { - "name": "idx_conditions_obs_replaces", - "columns": [ - { - "expression": "replaces", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gin", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "obs_confidence_score_range": { - "name": "obs_confidence_score_range", - "value": "\"conditions\".\"observations\".\"confidence_score\" IS NULL OR (\"conditions\".\"observations\".\"confidence_score\" >= 0 AND \"conditions\".\"observations\".\"confidence_score\" <= 1)" - }, - "obs_dp_epsilon_nonneg": { - "name": "obs_dp_epsilon_nonneg", - "value": "\"conditions\".\"observations\".\"dp_epsilon\" IS NULL OR \"conditions\".\"observations\".\"dp_epsilon\" >= 0" - }, - "obs_dp_delta_range": { - "name": "obs_dp_delta_range", - "value": "\"conditions\".\"observations\".\"dp_delta\" IS NULL OR (\"conditions\".\"observations\".\"dp_delta\" >= 0 AND \"conditions\".\"observations\".\"dp_delta\" < 1)" - }, - "obs_k_anonymity_positive": { - "name": "obs_k_anonymity_positive", - "value": "\"conditions\".\"observations\".\"k_anonymity\" IS NULL OR \"conditions\".\"observations\".\"k_anonymity\" > 0" - }, - "obs_severity_level_range": { - "name": "obs_severity_level_range", - "value": "\"conditions\".\"observations\".\"severity_level\" IS NULL OR (\"conditions\".\"observations\".\"severity_level\" >= 1 AND \"conditions\".\"observations\".\"severity_level\" <= 5)" - }, - "obs_fuzziness_enum": { - "name": "obs_fuzziness_enum", - "value": "\"conditions\".\"observations\".\"fuzziness\" IN ('exact','low_res','medium_res','end_unknown','start_unknown','extent_unknown')" - }, - "obs_privacy_class_enum": { - "name": "obs_privacy_class_enum", - "value": "\"conditions\".\"observations\".\"privacy_class\" IN ('unknown','authoritative','aggregate','k_anon','dp_noised','crowd_pseudonym')" - }, - "obs_evidence_state_enum": { - "name": "obs_evidence_state_enum", - "value": "\"conditions\".\"observations\".\"evidence_state\" IS NULL OR \"conditions\".\"observations\".\"evidence_state\" IN ('self_reported','corroborated','externally_resolved','negated','expired')" - }, - "obs_tombstone_reason_enum": { - "name": "obs_tombstone_reason_enum", - "value": "\"conditions\".\"observations\".\"tombstone_reason\" IS NULL OR \"conditions\".\"observations\".\"tombstone_reason\" IN ('deleted_by_source','gdpr_erasure','retracted_as_wrong','expired','legal_takedown')" - } - }, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_observation": { - "name": "idx_report_evidence_observation", - "columns": [ - { - "expression": "observation_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"conditions\".\"report_evidence\".\"evidence_kind\" IN ('report','confirm','negate','official_match','reviewer_accept','reviewer_reject','expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "sensor_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_hourly": { - "name": "sensor_speed_hourly", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "speed_bins": { - "name": "speed_bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": true - }, - "speed_counts": { - "name": "speed_counts", - "type": "integer[]", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_hourly_hour": { - "name": "idx_sensor_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_speed_hourly_sensor_key_hour_utc_pk": { - "name": "sensor_speed_hourly_sensor_key_hour_utc_pk", - "columns": [ - "sensor_key", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_sample": { - "name": "sensor_speed_sample", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_sample_key_bucket": { - "name": "idx_sensor_sample_key_bucket", - "columns": [ - { - "expression": "sensor_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_hour", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_sensor_sample_observed": { - "name": "idx_sensor_sample_observed", - "columns": [ - { - "expression": "observed_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_sensor_sample_key_observed": { - "name": "uq_sensor_sample_key_observed", - "columns": [ - "sensor_key", - "observed_at" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_sub_claim_subject": { - "name": "idx_sub_claim_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"conditions\".\"sub_claim\".\"claim_type\" IN ('confirm','negate','flag')" - } - }, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "views": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0029_snapshot.json b/packages/core/drizzle/meta/0029_snapshot.json deleted file mode 100644 index c1c66b45c..000000000 --- a/packages/core/drizzle/meta/0029_snapshot.json +++ /dev/null @@ -1,3127 +0,0 @@ -{ - "id": "ec3a59f2-76c0-4073-a452-112c68880025", - "prevId": "0d0152b2-b3a3-4354-a0f0-73a93249fc47", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "observation_revision": { - "name": "observation_revision", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "binding_queue_observation_id_observations_id_fk": { - "name": "binding_queue_observation_id_observations_id_fk", - "tableFrom": "binding_queue", - "columnsFrom": [ - "observation_id" - ], - "tableTo": "observations", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "object_id": { - "name": "object_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_snapshot": { - "name": "payload_snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_object": { - "name": "idx_federation_outbox_object", - "columns": [ - { - "expression": "object_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_binding": { - "name": "observation_binding", - "schema": "conditions", - "columns": { - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'single'" - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observation_revision": { - "name": "observation_revision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_binding_status": { - "name": "idx_observation_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "observation_binding_observation_id_observations_id_fk": { - "name": "observation_binding_observation_id_observations_id_fk", - "tableFrom": "observation_binding", - "columnsFrom": [ - "observation_id" - ], - "tableTo": "observations", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_segment": { - "name": "observation_segment", - "schema": "conditions", - "columns": { - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_segment_segment": { - "name": "idx_observation_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "observation_segment_observation_id_observations_id_fk": { - "name": "observation_segment_observation_id_observations_id_fk", - "tableFrom": "observation_segment", - "columnsFrom": [ - "observation_id" - ], - "tableTo": "observations", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "observation_segment_observation_id_seq_pk": { - "name": "observation_segment_observation_id_seq_pk", - "columns": [ - "observation_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observations": { - "name": "observations", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_format": { - "name": "source_format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity_source": { - "name": "severity_source", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "headline": { - "name": "headline", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "metric": { - "name": "metric", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "level": { - "name": "level", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "aggregation": { - "name": "aggregation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "subject": { - "name": "subject", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "attributes": { - "name": "attributes", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "schedule": { - "name": "schedule", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_forecast": { - "name": "is_forecast", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "related_ids": { - "name": "related_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "origin": { - "name": "origin", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "data_updated_at": { - "name": "data_updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "is_stale": { - "name": "is_stale", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "stale_after": { - "name": "stale_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "phenomenon_fingerprint": { - "name": "phenomenon_fingerprint", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "replaces": { - "name": "replaces", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "fuzziness": { - "name": "fuzziness", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'exact'" - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'unknown'" - }, - "k_anonymity": { - "name": "k_anonymity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "dp_epsilon": { - "name": "dp_epsilon", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "dp_delta": { - "name": "dp_delta", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "informed": { - "name": "informed", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "source_uri": { - "name": "source_uri", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_license": { - "name": "source_license", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_conditions_obs_geom": { - "name": "idx_conditions_obs_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_conditions_obs_domain": { - "name": "idx_conditions_obs_domain", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_dom_type": { - "name": "idx_conditions_obs_dom_type", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_severity": { - "name": "idx_conditions_obs_severity", - "columns": [ - { - "expression": "severity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_metric": { - "name": "idx_conditions_obs_metric", - "columns": [ - { - "expression": "metric", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_valid_to": { - "name": "idx_conditions_obs_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_expires": { - "name": "idx_conditions_obs_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_subject": { - "name": "idx_conditions_obs_subject", - "columns": [ - { - "expression": "subject", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gin", - "concurrently": false - }, - "idx_conditions_obs_source": { - "name": "idx_conditions_obs_source", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_canonical": { - "name": "idx_conditions_obs_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_content_hash": { - "name": "idx_conditions_obs_content_hash", - "columns": [ - { - "expression": "content_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_phenomenon": { - "name": "idx_conditions_obs_phenomenon", - "columns": [ - { - "expression": "phenomenon_fingerprint", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_instance": { - "name": "idx_conditions_obs_instance", - "columns": [ - { - "expression": "instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_privacy": { - "name": "idx_conditions_obs_privacy", - "columns": [ - { - "expression": "privacy_class", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_evidence_state": { - "name": "idx_conditions_obs_evidence_state", - "columns": [ - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_flagged": { - "name": "idx_conditions_obs_flagged", - "columns": [ - { - "expression": "flagged_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"observations\".\"flagged_at\" IS NOT NULL", - "concurrently": false - }, - "idx_conditions_obs_corroborations": { - "name": "idx_conditions_obs_corroborations", - "columns": [ - { - "expression": "corroborations", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gin", - "concurrently": false - }, - "idx_conditions_obs_replaces": { - "name": "idx_conditions_obs_replaces", - "columns": [ - { - "expression": "replaces", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gin", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "obs_confidence_score_range": { - "name": "obs_confidence_score_range", - "value": "\"conditions\".\"observations\".\"confidence_score\" IS NULL OR (\"conditions\".\"observations\".\"confidence_score\" >= 0 AND \"conditions\".\"observations\".\"confidence_score\" <= 1)" - }, - "obs_dp_epsilon_nonneg": { - "name": "obs_dp_epsilon_nonneg", - "value": "\"conditions\".\"observations\".\"dp_epsilon\" IS NULL OR \"conditions\".\"observations\".\"dp_epsilon\" >= 0" - }, - "obs_dp_delta_range": { - "name": "obs_dp_delta_range", - "value": "\"conditions\".\"observations\".\"dp_delta\" IS NULL OR (\"conditions\".\"observations\".\"dp_delta\" >= 0 AND \"conditions\".\"observations\".\"dp_delta\" < 1)" - }, - "obs_k_anonymity_positive": { - "name": "obs_k_anonymity_positive", - "value": "\"conditions\".\"observations\".\"k_anonymity\" IS NULL OR \"conditions\".\"observations\".\"k_anonymity\" > 0" - }, - "obs_severity_level_range": { - "name": "obs_severity_level_range", - "value": "\"conditions\".\"observations\".\"severity_level\" IS NULL OR (\"conditions\".\"observations\".\"severity_level\" >= 1 AND \"conditions\".\"observations\".\"severity_level\" <= 5)" - }, - "obs_fuzziness_enum": { - "name": "obs_fuzziness_enum", - "value": "\"conditions\".\"observations\".\"fuzziness\" IN ('exact','low_res','medium_res','end_unknown','start_unknown','extent_unknown')" - }, - "obs_privacy_class_enum": { - "name": "obs_privacy_class_enum", - "value": "\"conditions\".\"observations\".\"privacy_class\" IN ('unknown','authoritative','aggregate','k_anon','dp_noised','crowd_pseudonym')" - }, - "obs_evidence_state_enum": { - "name": "obs_evidence_state_enum", - "value": "\"conditions\".\"observations\".\"evidence_state\" IS NULL OR \"conditions\".\"observations\".\"evidence_state\" IN ('self_reported','corroborated','externally_resolved','negated','expired')" - }, - "obs_tombstone_reason_enum": { - "name": "obs_tombstone_reason_enum", - "value": "\"conditions\".\"observations\".\"tombstone_reason\" IS NULL OR \"conditions\".\"observations\".\"tombstone_reason\" IN ('deleted_by_source','gdpr_erasure','retracted_as_wrong','expired','legal_takedown')" - } - }, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_observation": { - "name": "idx_report_evidence_observation", - "columns": [ - { - "expression": "observation_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"conditions\".\"report_evidence\".\"evidence_kind\" IN ('report','confirm','negate','official_match','reviewer_accept','reviewer_reject','expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "sensor_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_hourly": { - "name": "sensor_speed_hourly", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "speed_bins": { - "name": "speed_bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": true - }, - "speed_counts": { - "name": "speed_counts", - "type": "integer[]", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_hourly_hour": { - "name": "idx_sensor_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_speed_hourly_sensor_key_hour_utc_pk": { - "name": "sensor_speed_hourly_sensor_key_hour_utc_pk", - "columns": [ - "sensor_key", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_sample": { - "name": "sensor_speed_sample", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_sample_key_bucket": { - "name": "idx_sensor_sample_key_bucket", - "columns": [ - { - "expression": "sensor_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_hour", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_sensor_sample_observed": { - "name": "idx_sensor_sample_observed", - "columns": [ - { - "expression": "observed_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_sensor_sample_key_observed": { - "name": "uq_sensor_sample_key_observed", - "columns": [ - "sensor_key", - "observed_at" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_sub_claim_subject": { - "name": "idx_sub_claim_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"conditions\".\"sub_claim\".\"claim_type\" IN ('confirm','negate','flag')" - } - }, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "views": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0030_snapshot.json b/packages/core/drizzle/meta/0030_snapshot.json deleted file mode 100644 index d43b0bee1..000000000 --- a/packages/core/drizzle/meta/0030_snapshot.json +++ /dev/null @@ -1,3148 +0,0 @@ -{ - "id": "cabfa903-2f98-428e-8a8a-ee8e2603c7fe", - "prevId": "ec3a59f2-76c0-4073-a452-112c68880025", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "observation_revision": { - "name": "observation_revision", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "binding_queue_observation_id_observations_id_fk": { - "name": "binding_queue_observation_id_observations_id_fk", - "tableFrom": "binding_queue", - "tableTo": "observations", - "schemaTo": "conditions", - "columnsFrom": [ - "observation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "object_id": { - "name": "object_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_snapshot": { - "name": "payload_snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_object": { - "name": "idx_federation_outbox_object", - "columns": [ - { - "expression": "object_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_binding": { - "name": "observation_binding", - "schema": "conditions", - "columns": { - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'single'" - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observation_revision": { - "name": "observation_revision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_binding_status": { - "name": "idx_observation_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_binding_observation_id_observations_id_fk": { - "name": "observation_binding_observation_id_observations_id_fk", - "tableFrom": "observation_binding", - "tableTo": "observations", - "schemaTo": "conditions", - "columnsFrom": [ - "observation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_segment": { - "name": "observation_segment", - "schema": "conditions", - "columns": { - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_segment_segment": { - "name": "idx_observation_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_segment_observation_id_observations_id_fk": { - "name": "observation_segment_observation_id_observations_id_fk", - "tableFrom": "observation_segment", - "tableTo": "observations", - "schemaTo": "conditions", - "columnsFrom": [ - "observation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_segment_observation_id_seq_pk": { - "name": "observation_segment_observation_id_seq_pk", - "columns": [ - "observation_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observations": { - "name": "observations", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_format": { - "name": "source_format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity_source": { - "name": "severity_source", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "headline": { - "name": "headline", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "metric": { - "name": "metric", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "level": { - "name": "level", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "aggregation": { - "name": "aggregation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "subject": { - "name": "subject", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "attributes": { - "name": "attributes", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "schedule": { - "name": "schedule", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_forecast": { - "name": "is_forecast", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "related_ids": { - "name": "related_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "origin": { - "name": "origin", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "data_updated_at": { - "name": "data_updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "is_stale": { - "name": "is_stale", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "stale_after": { - "name": "stale_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "phenomenon_fingerprint": { - "name": "phenomenon_fingerprint", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "replaces": { - "name": "replaces", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "fuzziness": { - "name": "fuzziness", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'exact'" - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'unknown'" - }, - "k_anonymity": { - "name": "k_anonymity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "dp_epsilon": { - "name": "dp_epsilon", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "dp_delta": { - "name": "dp_delta", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "informed": { - "name": "informed", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "source_uri": { - "name": "source_uri", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_license": { - "name": "source_license", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_conditions_obs_geom": { - "name": "idx_conditions_obs_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_conditions_obs_domain": { - "name": "idx_conditions_obs_domain", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_dom_type": { - "name": "idx_conditions_obs_dom_type", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_severity": { - "name": "idx_conditions_obs_severity", - "columns": [ - { - "expression": "severity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_metric": { - "name": "idx_conditions_obs_metric", - "columns": [ - { - "expression": "metric", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_valid_to": { - "name": "idx_conditions_obs_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_expires": { - "name": "idx_conditions_obs_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_subject": { - "name": "idx_conditions_obs_subject", - "columns": [ - { - "expression": "subject", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_source": { - "name": "idx_conditions_obs_source", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_canonical": { - "name": "idx_conditions_obs_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_content_hash": { - "name": "idx_conditions_obs_content_hash", - "columns": [ - { - "expression": "content_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_phenomenon": { - "name": "idx_conditions_obs_phenomenon", - "columns": [ - { - "expression": "phenomenon_fingerprint", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_instance": { - "name": "idx_conditions_obs_instance", - "columns": [ - { - "expression": "instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_privacy": { - "name": "idx_conditions_obs_privacy", - "columns": [ - { - "expression": "privacy_class", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_evidence_state": { - "name": "idx_conditions_obs_evidence_state", - "columns": [ - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_flagged": { - "name": "idx_conditions_obs_flagged", - "columns": [ - { - "expression": "flagged_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observations\".\"flagged_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_corroborations": { - "name": "idx_conditions_obs_corroborations", - "columns": [ - { - "expression": "corroborations", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_replaces": { - "name": "idx_conditions_obs_replaces", - "columns": [ - { - "expression": "replaces", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "obs_confidence_score_range": { - "name": "obs_confidence_score_range", - "value": "\"conditions\".\"observations\".\"confidence_score\" IS NULL OR (\"conditions\".\"observations\".\"confidence_score\" >= 0 AND \"conditions\".\"observations\".\"confidence_score\" <= 1)" - }, - "obs_dp_epsilon_nonneg": { - "name": "obs_dp_epsilon_nonneg", - "value": "\"conditions\".\"observations\".\"dp_epsilon\" IS NULL OR \"conditions\".\"observations\".\"dp_epsilon\" >= 0" - }, - "obs_dp_delta_range": { - "name": "obs_dp_delta_range", - "value": "\"conditions\".\"observations\".\"dp_delta\" IS NULL OR (\"conditions\".\"observations\".\"dp_delta\" >= 0 AND \"conditions\".\"observations\".\"dp_delta\" < 1)" - }, - "obs_k_anonymity_positive": { - "name": "obs_k_anonymity_positive", - "value": "\"conditions\".\"observations\".\"k_anonymity\" IS NULL OR \"conditions\".\"observations\".\"k_anonymity\" > 0" - }, - "obs_severity_level_range": { - "name": "obs_severity_level_range", - "value": "\"conditions\".\"observations\".\"severity_level\" IS NULL OR (\"conditions\".\"observations\".\"severity_level\" >= 1 AND \"conditions\".\"observations\".\"severity_level\" <= 5)" - }, - "obs_fuzziness_enum": { - "name": "obs_fuzziness_enum", - "value": "\"conditions\".\"observations\".\"fuzziness\" IN ('exact','low_res','medium_res','end_unknown','start_unknown','extent_unknown')" - }, - "obs_privacy_class_enum": { - "name": "obs_privacy_class_enum", - "value": "\"conditions\".\"observations\".\"privacy_class\" IN ('unknown','authoritative','aggregate','k_anon','dp_noised','crowd_pseudonym')" - }, - "obs_evidence_state_enum": { - "name": "obs_evidence_state_enum", - "value": "\"conditions\".\"observations\".\"evidence_state\" IS NULL OR \"conditions\".\"observations\".\"evidence_state\" IN ('self_reported','corroborated','externally_resolved','negated','expired')" - }, - "obs_tombstone_reason_enum": { - "name": "obs_tombstone_reason_enum", - "value": "\"conditions\".\"observations\".\"tombstone_reason\" IS NULL OR \"conditions\".\"observations\".\"tombstone_reason\" IN ('deleted_by_source','gdpr_erasure','retracted_as_wrong','expired','legal_takedown')" - } - }, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_observation": { - "name": "idx_report_evidence_observation", - "columns": [ - { - "expression": "observation_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"conditions\".\"report_evidence\".\"evidence_kind\" IN ('report','confirm','negate','official_match','reviewer_accept','reviewer_reject','expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "sensor_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_hourly": { - "name": "sensor_speed_hourly", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "speed_bins": { - "name": "speed_bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": true - }, - "speed_counts": { - "name": "speed_counts", - "type": "integer[]", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_hourly_hour": { - "name": "idx_sensor_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_speed_hourly_sensor_key_hour_utc_pk": { - "name": "sensor_speed_hourly_sensor_key_hour_utc_pk", - "columns": [ - "sensor_key", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_sample": { - "name": "sensor_speed_sample", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_sample_key_bucket": { - "name": "idx_sensor_sample_key_bucket", - "columns": [ - { - "expression": "sensor_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_hour", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sensor_sample_observed": { - "name": "idx_sensor_sample_observed", - "columns": [ - { - "expression": "observed_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_sensor_sample_key_observed": { - "name": "uq_sensor_sample_key_observed", - "nullsNotDistinct": false, - "columns": [ - "sensor_key", - "observed_at" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_subject": { - "name": "idx_sub_claim_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"conditions\".\"sub_claim\".\"claim_type\" IN ('confirm','negate','flag')" - } - }, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0031_snapshot.json b/packages/core/drizzle/meta/0031_snapshot.json deleted file mode 100644 index 4f47a03f3..000000000 --- a/packages/core/drizzle/meta/0031_snapshot.json +++ /dev/null @@ -1,3155 +0,0 @@ -{ - "id": "445ff44d-db6a-4b7b-b491-9e86f3d6afe3", - "prevId": "cabfa903-2f98-428e-8a8a-ee8e2603c7fe", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "observation_revision": { - "name": "observation_revision", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "binding_queue_observation_id_observations_id_fk": { - "name": "binding_queue_observation_id_observations_id_fk", - "tableFrom": "binding_queue", - "tableTo": "observations", - "schemaTo": "conditions", - "columnsFrom": [ - "observation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "object_id": { - "name": "object_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_snapshot": { - "name": "payload_snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_object": { - "name": "idx_federation_outbox_object", - "columns": [ - { - "expression": "object_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_binding": { - "name": "observation_binding", - "schema": "conditions", - "columns": { - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'single'" - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observation_revision": { - "name": "observation_revision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_binding_status": { - "name": "idx_observation_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_binding_observation_id_observations_id_fk": { - "name": "observation_binding_observation_id_observations_id_fk", - "tableFrom": "observation_binding", - "tableTo": "observations", - "schemaTo": "conditions", - "columnsFrom": [ - "observation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_segment": { - "name": "observation_segment", - "schema": "conditions", - "columns": { - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_segment_segment": { - "name": "idx_observation_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_segment_observation_id_observations_id_fk": { - "name": "observation_segment_observation_id_observations_id_fk", - "tableFrom": "observation_segment", - "tableTo": "observations", - "schemaTo": "conditions", - "columnsFrom": [ - "observation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_segment_observation_id_seq_pk": { - "name": "observation_segment_observation_id_seq_pk", - "columns": [ - "observation_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observations": { - "name": "observations", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_format": { - "name": "source_format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity_source": { - "name": "severity_source", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "headline": { - "name": "headline", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "metric": { - "name": "metric", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "level": { - "name": "level", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "aggregation": { - "name": "aggregation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "subject": { - "name": "subject", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "attributes": { - "name": "attributes", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "schedule": { - "name": "schedule", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_forecast": { - "name": "is_forecast", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "related_ids": { - "name": "related_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "origin": { - "name": "origin", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "data_updated_at": { - "name": "data_updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "is_stale": { - "name": "is_stale", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "stale_after": { - "name": "stale_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "phenomenon_fingerprint": { - "name": "phenomenon_fingerprint", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "replaces": { - "name": "replaces", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "fuzziness": { - "name": "fuzziness", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'exact'" - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'unknown'" - }, - "k_anonymity": { - "name": "k_anonymity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "dp_epsilon": { - "name": "dp_epsilon", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "dp_delta": { - "name": "dp_delta", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "informed": { - "name": "informed", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "source_uri": { - "name": "source_uri", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_license": { - "name": "source_license", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_conditions_obs_geom": { - "name": "idx_conditions_obs_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_conditions_obs_domain": { - "name": "idx_conditions_obs_domain", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_dom_type": { - "name": "idx_conditions_obs_dom_type", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_severity": { - "name": "idx_conditions_obs_severity", - "columns": [ - { - "expression": "severity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_metric": { - "name": "idx_conditions_obs_metric", - "columns": [ - { - "expression": "metric", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_valid_to": { - "name": "idx_conditions_obs_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_expires": { - "name": "idx_conditions_obs_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_subject": { - "name": "idx_conditions_obs_subject", - "columns": [ - { - "expression": "subject", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_source": { - "name": "idx_conditions_obs_source", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_canonical": { - "name": "idx_conditions_obs_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_content_hash": { - "name": "idx_conditions_obs_content_hash", - "columns": [ - { - "expression": "content_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_phenomenon": { - "name": "idx_conditions_obs_phenomenon", - "columns": [ - { - "expression": "phenomenon_fingerprint", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_instance": { - "name": "idx_conditions_obs_instance", - "columns": [ - { - "expression": "instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_privacy": { - "name": "idx_conditions_obs_privacy", - "columns": [ - { - "expression": "privacy_class", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_evidence_state": { - "name": "idx_conditions_obs_evidence_state", - "columns": [ - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_flagged": { - "name": "idx_conditions_obs_flagged", - "columns": [ - { - "expression": "flagged_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observations\".\"flagged_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_corroborations": { - "name": "idx_conditions_obs_corroborations", - "columns": [ - { - "expression": "corroborations", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_replaces": { - "name": "idx_conditions_obs_replaces", - "columns": [ - { - "expression": "replaces", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "obs_confidence_score_range": { - "name": "obs_confidence_score_range", - "value": "\"conditions\".\"observations\".\"confidence_score\" IS NULL OR (\"conditions\".\"observations\".\"confidence_score\" >= 0 AND \"conditions\".\"observations\".\"confidence_score\" <= 1)" - }, - "obs_dp_epsilon_nonneg": { - "name": "obs_dp_epsilon_nonneg", - "value": "\"conditions\".\"observations\".\"dp_epsilon\" IS NULL OR \"conditions\".\"observations\".\"dp_epsilon\" >= 0" - }, - "obs_dp_delta_range": { - "name": "obs_dp_delta_range", - "value": "\"conditions\".\"observations\".\"dp_delta\" IS NULL OR (\"conditions\".\"observations\".\"dp_delta\" >= 0 AND \"conditions\".\"observations\".\"dp_delta\" < 1)" - }, - "obs_k_anonymity_positive": { - "name": "obs_k_anonymity_positive", - "value": "\"conditions\".\"observations\".\"k_anonymity\" IS NULL OR \"conditions\".\"observations\".\"k_anonymity\" > 0" - }, - "obs_severity_level_range": { - "name": "obs_severity_level_range", - "value": "\"conditions\".\"observations\".\"severity_level\" IS NULL OR (\"conditions\".\"observations\".\"severity_level\" >= 1 AND \"conditions\".\"observations\".\"severity_level\" <= 5)" - }, - "obs_fuzziness_enum": { - "name": "obs_fuzziness_enum", - "value": "\"conditions\".\"observations\".\"fuzziness\" IN ('exact','low_res','medium_res','end_unknown','start_unknown','extent_unknown')" - }, - "obs_privacy_class_enum": { - "name": "obs_privacy_class_enum", - "value": "\"conditions\".\"observations\".\"privacy_class\" IN ('unknown','authoritative','aggregate','k_anon','dp_noised','crowd_pseudonym')" - }, - "obs_evidence_state_enum": { - "name": "obs_evidence_state_enum", - "value": "\"conditions\".\"observations\".\"evidence_state\" IS NULL OR \"conditions\".\"observations\".\"evidence_state\" IN ('self_reported','corroborated','externally_resolved','negated','expired')" - }, - "obs_tombstone_reason_enum": { - "name": "obs_tombstone_reason_enum", - "value": "\"conditions\".\"observations\".\"tombstone_reason\" IS NULL OR \"conditions\".\"observations\".\"tombstone_reason\" IN ('deleted_by_source','gdpr_erasure','retracted_as_wrong','expired','legal_takedown')" - } - }, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_observation": { - "name": "idx_report_evidence_observation", - "columns": [ - { - "expression": "observation_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"conditions\".\"report_evidence\".\"evidence_kind\" IN ('report','confirm','negate','official_match','reviewer_accept','reviewer_reject','expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "sensor_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_hourly": { - "name": "sensor_speed_hourly", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "speed_bins": { - "name": "speed_bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": true - }, - "speed_counts": { - "name": "speed_counts", - "type": "integer[]", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_hourly_hour": { - "name": "idx_sensor_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_speed_hourly_sensor_key_hour_utc_pk": { - "name": "sensor_speed_hourly_sensor_key_hour_utc_pk", - "columns": [ - "sensor_key", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_sample": { - "name": "sensor_speed_sample", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_sample_key_bucket": { - "name": "idx_sensor_sample_key_bucket", - "columns": [ - { - "expression": "sensor_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_hour", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sensor_sample_observed": { - "name": "idx_sensor_sample_observed", - "columns": [ - { - "expression": "observed_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_sensor_sample_key_observed": { - "name": "uq_sensor_sample_key_observed", - "nullsNotDistinct": false, - "columns": [ - "sensor_key", - "observed_at" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_subject": { - "name": "idx_sub_claim_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"conditions\".\"sub_claim\".\"claim_type\" IN ('confirm','negate','flag')" - } - }, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0032_snapshot.json b/packages/core/drizzle/meta/0032_snapshot.json deleted file mode 100644 index 6b479cad9..000000000 --- a/packages/core/drizzle/meta/0032_snapshot.json +++ /dev/null @@ -1,3162 +0,0 @@ -{ - "id": "78c36bc4-79bf-4888-baba-637e0dacd2c2", - "prevId": "445ff44d-db6a-4b7b-b491-9e86f3d6afe3", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "observation_revision": { - "name": "observation_revision", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "binding_queue_observation_id_observations_id_fk": { - "name": "binding_queue_observation_id_observations_id_fk", - "tableFrom": "binding_queue", - "tableTo": "observations", - "schemaTo": "conditions", - "columnsFrom": [ - "observation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "object_id": { - "name": "object_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_snapshot": { - "name": "payload_snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_object": { - "name": "idx_federation_outbox_object", - "columns": [ - { - "expression": "object_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_binding": { - "name": "observation_binding", - "schema": "conditions", - "columns": { - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'single'" - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observation_revision": { - "name": "observation_revision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_binding_status": { - "name": "idx_observation_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_binding_observation_id_observations_id_fk": { - "name": "observation_binding_observation_id_observations_id_fk", - "tableFrom": "observation_binding", - "tableTo": "observations", - "schemaTo": "conditions", - "columnsFrom": [ - "observation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_segment": { - "name": "observation_segment", - "schema": "conditions", - "columns": { - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_segment_segment": { - "name": "idx_observation_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_segment_observation_id_observations_id_fk": { - "name": "observation_segment_observation_id_observations_id_fk", - "tableFrom": "observation_segment", - "tableTo": "observations", - "schemaTo": "conditions", - "columnsFrom": [ - "observation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_segment_observation_id_seq_pk": { - "name": "observation_segment_observation_id_seq_pk", - "columns": [ - "observation_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observations": { - "name": "observations", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_format": { - "name": "source_format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity_source": { - "name": "severity_source", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "headline": { - "name": "headline", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "metric": { - "name": "metric", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "level": { - "name": "level", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "aggregation": { - "name": "aggregation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "subject": { - "name": "subject", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "attributes": { - "name": "attributes", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "schedule": { - "name": "schedule", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_forecast": { - "name": "is_forecast", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "related_ids": { - "name": "related_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "origin": { - "name": "origin", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "data_updated_at": { - "name": "data_updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "is_stale": { - "name": "is_stale", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "stale_after": { - "name": "stale_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "phenomenon_fingerprint": { - "name": "phenomenon_fingerprint", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "replaces": { - "name": "replaces", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "fuzziness": { - "name": "fuzziness", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'exact'" - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'unknown'" - }, - "k_anonymity": { - "name": "k_anonymity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "dp_epsilon": { - "name": "dp_epsilon", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "dp_delta": { - "name": "dp_delta", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "informed": { - "name": "informed", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "source_uri": { - "name": "source_uri", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_license": { - "name": "source_license", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_conditions_obs_geom": { - "name": "idx_conditions_obs_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_conditions_obs_domain": { - "name": "idx_conditions_obs_domain", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_dom_type": { - "name": "idx_conditions_obs_dom_type", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_severity": { - "name": "idx_conditions_obs_severity", - "columns": [ - { - "expression": "severity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_metric": { - "name": "idx_conditions_obs_metric", - "columns": [ - { - "expression": "metric", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_valid_to": { - "name": "idx_conditions_obs_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_expires": { - "name": "idx_conditions_obs_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_subject": { - "name": "idx_conditions_obs_subject", - "columns": [ - { - "expression": "subject", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_source": { - "name": "idx_conditions_obs_source", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_canonical": { - "name": "idx_conditions_obs_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_content_hash": { - "name": "idx_conditions_obs_content_hash", - "columns": [ - { - "expression": "content_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_phenomenon": { - "name": "idx_conditions_obs_phenomenon", - "columns": [ - { - "expression": "phenomenon_fingerprint", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_instance": { - "name": "idx_conditions_obs_instance", - "columns": [ - { - "expression": "instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_privacy": { - "name": "idx_conditions_obs_privacy", - "columns": [ - { - "expression": "privacy_class", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_evidence_state": { - "name": "idx_conditions_obs_evidence_state", - "columns": [ - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_flagged": { - "name": "idx_conditions_obs_flagged", - "columns": [ - { - "expression": "flagged_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observations\".\"flagged_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_corroborations": { - "name": "idx_conditions_obs_corroborations", - "columns": [ - { - "expression": "corroborations", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_replaces": { - "name": "idx_conditions_obs_replaces", - "columns": [ - { - "expression": "replaces", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "obs_confidence_score_range": { - "name": "obs_confidence_score_range", - "value": "\"conditions\".\"observations\".\"confidence_score\" IS NULL OR (\"conditions\".\"observations\".\"confidence_score\" >= 0 AND \"conditions\".\"observations\".\"confidence_score\" <= 1)" - }, - "obs_dp_epsilon_nonneg": { - "name": "obs_dp_epsilon_nonneg", - "value": "\"conditions\".\"observations\".\"dp_epsilon\" IS NULL OR \"conditions\".\"observations\".\"dp_epsilon\" >= 0" - }, - "obs_dp_delta_range": { - "name": "obs_dp_delta_range", - "value": "\"conditions\".\"observations\".\"dp_delta\" IS NULL OR (\"conditions\".\"observations\".\"dp_delta\" >= 0 AND \"conditions\".\"observations\".\"dp_delta\" < 1)" - }, - "obs_k_anonymity_positive": { - "name": "obs_k_anonymity_positive", - "value": "\"conditions\".\"observations\".\"k_anonymity\" IS NULL OR \"conditions\".\"observations\".\"k_anonymity\" > 0" - }, - "obs_severity_level_range": { - "name": "obs_severity_level_range", - "value": "\"conditions\".\"observations\".\"severity_level\" IS NULL OR (\"conditions\".\"observations\".\"severity_level\" >= 1 AND \"conditions\".\"observations\".\"severity_level\" <= 5)" - }, - "obs_fuzziness_enum": { - "name": "obs_fuzziness_enum", - "value": "\"conditions\".\"observations\".\"fuzziness\" IN ('exact','low_res','medium_res','end_unknown','start_unknown','extent_unknown')" - }, - "obs_privacy_class_enum": { - "name": "obs_privacy_class_enum", - "value": "\"conditions\".\"observations\".\"privacy_class\" IN ('unknown','authoritative','aggregate','k_anon','dp_noised','crowd_pseudonym')" - }, - "obs_evidence_state_enum": { - "name": "obs_evidence_state_enum", - "value": "\"conditions\".\"observations\".\"evidence_state\" IS NULL OR \"conditions\".\"observations\".\"evidence_state\" IN ('self_reported','corroborated','externally_resolved','negated','expired')" - }, - "obs_tombstone_reason_enum": { - "name": "obs_tombstone_reason_enum", - "value": "\"conditions\".\"observations\".\"tombstone_reason\" IS NULL OR \"conditions\".\"observations\".\"tombstone_reason\" IN ('deleted_by_source','gdpr_erasure','retracted_as_wrong','expired','legal_takedown')" - } - }, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_observation": { - "name": "idx_report_evidence_observation", - "columns": [ - { - "expression": "observation_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"conditions\".\"report_evidence\".\"evidence_kind\" IN ('report','confirm','negate','official_match','reviewer_accept','reviewer_reject','expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "sensor_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_hourly": { - "name": "sensor_speed_hourly", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "speed_bins": { - "name": "speed_bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": true - }, - "speed_counts": { - "name": "speed_counts", - "type": "integer[]", - "primaryKey": false, - "notNull": true - }, - "finalized": { - "name": "finalized", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "idx_sensor_hourly_hour": { - "name": "idx_sensor_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_speed_hourly_sensor_key_hour_utc_pk": { - "name": "sensor_speed_hourly_sensor_key_hour_utc_pk", - "columns": [ - "sensor_key", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_sample": { - "name": "sensor_speed_sample", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_sample_key_bucket": { - "name": "idx_sensor_sample_key_bucket", - "columns": [ - { - "expression": "sensor_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_hour", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sensor_sample_observed": { - "name": "idx_sensor_sample_observed", - "columns": [ - { - "expression": "observed_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_sensor_sample_key_observed": { - "name": "uq_sensor_sample_key_observed", - "nullsNotDistinct": false, - "columns": [ - "sensor_key", - "observed_at" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_subject": { - "name": "idx_sub_claim_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"conditions\".\"sub_claim\".\"claim_type\" IN ('confirm','negate','flag')" - } - }, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0033_snapshot.json b/packages/core/drizzle/meta/0033_snapshot.json deleted file mode 100644 index 7e0a4e2d0..000000000 --- a/packages/core/drizzle/meta/0033_snapshot.json +++ /dev/null @@ -1,3193 +0,0 @@ -{ - "id": "bfab6bca-cafe-448a-94e3-7286048daa17", - "prevId": "78c36bc4-79bf-4888-baba-637e0dacd2c2", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "observation_revision": { - "name": "observation_revision", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "binding_queue_observation_id_observations_id_fk": { - "name": "binding_queue_observation_id_observations_id_fk", - "tableFrom": "binding_queue", - "tableTo": "observations", - "schemaTo": "conditions", - "columnsFrom": [ - "observation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "object_id": { - "name": "object_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_snapshot": { - "name": "payload_snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_object": { - "name": "idx_federation_outbox_object", - "columns": [ - { - "expression": "object_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_binding": { - "name": "observation_binding", - "schema": "conditions", - "columns": { - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'single'" - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observation_revision": { - "name": "observation_revision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_binding_status": { - "name": "idx_observation_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_binding_observation_id_observations_id_fk": { - "name": "observation_binding_observation_id_observations_id_fk", - "tableFrom": "observation_binding", - "tableTo": "observations", - "schemaTo": "conditions", - "columnsFrom": [ - "observation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_segment": { - "name": "observation_segment", - "schema": "conditions", - "columns": { - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_segment_segment": { - "name": "idx_observation_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_segment_observation_id_observations_id_fk": { - "name": "observation_segment_observation_id_observations_id_fk", - "tableFrom": "observation_segment", - "tableTo": "observations", - "schemaTo": "conditions", - "columnsFrom": [ - "observation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_segment_observation_id_seq_pk": { - "name": "observation_segment_observation_id_seq_pk", - "columns": [ - "observation_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observations": { - "name": "observations", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_format": { - "name": "source_format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity_source": { - "name": "severity_source", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "headline": { - "name": "headline", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "metric": { - "name": "metric", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "level": { - "name": "level", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "aggregation": { - "name": "aggregation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "subject": { - "name": "subject", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "attributes": { - "name": "attributes", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "schedule": { - "name": "schedule", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_forecast": { - "name": "is_forecast", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "related_ids": { - "name": "related_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "origin": { - "name": "origin", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "data_updated_at": { - "name": "data_updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "is_stale": { - "name": "is_stale", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "stale_after": { - "name": "stale_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "phenomenon_fingerprint": { - "name": "phenomenon_fingerprint", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "replaces": { - "name": "replaces", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "fuzziness": { - "name": "fuzziness", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'exact'" - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'unknown'" - }, - "k_anonymity": { - "name": "k_anonymity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "dp_epsilon": { - "name": "dp_epsilon", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "dp_delta": { - "name": "dp_delta", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "informed": { - "name": "informed", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "source_uri": { - "name": "source_uri", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_license": { - "name": "source_license", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_conditions_obs_geom": { - "name": "idx_conditions_obs_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_conditions_obs_domain": { - "name": "idx_conditions_obs_domain", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_dom_type": { - "name": "idx_conditions_obs_dom_type", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_severity": { - "name": "idx_conditions_obs_severity", - "columns": [ - { - "expression": "severity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_metric": { - "name": "idx_conditions_obs_metric", - "columns": [ - { - "expression": "metric", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_valid_to": { - "name": "idx_conditions_obs_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_expires": { - "name": "idx_conditions_obs_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_subject": { - "name": "idx_conditions_obs_subject", - "columns": [ - { - "expression": "subject", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_source": { - "name": "idx_conditions_obs_source", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_canonical": { - "name": "idx_conditions_obs_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_content_hash": { - "name": "idx_conditions_obs_content_hash", - "columns": [ - { - "expression": "content_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_phenomenon": { - "name": "idx_conditions_obs_phenomenon", - "columns": [ - { - "expression": "phenomenon_fingerprint", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_instance": { - "name": "idx_conditions_obs_instance", - "columns": [ - { - "expression": "instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_privacy": { - "name": "idx_conditions_obs_privacy", - "columns": [ - { - "expression": "privacy_class", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_evidence_state": { - "name": "idx_conditions_obs_evidence_state", - "columns": [ - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_flagged": { - "name": "idx_conditions_obs_flagged", - "columns": [ - { - "expression": "flagged_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observations\".\"flagged_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_corroborations": { - "name": "idx_conditions_obs_corroborations", - "columns": [ - { - "expression": "corroborations", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_replaces": { - "name": "idx_conditions_obs_replaces", - "columns": [ - { - "expression": "replaces", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "obs_confidence_score_range": { - "name": "obs_confidence_score_range", - "value": "\"conditions\".\"observations\".\"confidence_score\" IS NULL OR (\"conditions\".\"observations\".\"confidence_score\" >= 0 AND \"conditions\".\"observations\".\"confidence_score\" <= 1)" - }, - "obs_dp_epsilon_nonneg": { - "name": "obs_dp_epsilon_nonneg", - "value": "\"conditions\".\"observations\".\"dp_epsilon\" IS NULL OR \"conditions\".\"observations\".\"dp_epsilon\" >= 0" - }, - "obs_dp_delta_range": { - "name": "obs_dp_delta_range", - "value": "\"conditions\".\"observations\".\"dp_delta\" IS NULL OR (\"conditions\".\"observations\".\"dp_delta\" >= 0 AND \"conditions\".\"observations\".\"dp_delta\" < 1)" - }, - "obs_k_anonymity_positive": { - "name": "obs_k_anonymity_positive", - "value": "\"conditions\".\"observations\".\"k_anonymity\" IS NULL OR \"conditions\".\"observations\".\"k_anonymity\" > 0" - }, - "obs_severity_level_range": { - "name": "obs_severity_level_range", - "value": "\"conditions\".\"observations\".\"severity_level\" IS NULL OR (\"conditions\".\"observations\".\"severity_level\" >= 1 AND \"conditions\".\"observations\".\"severity_level\" <= 5)" - }, - "obs_fuzziness_enum": { - "name": "obs_fuzziness_enum", - "value": "\"conditions\".\"observations\".\"fuzziness\" IN ('exact','low_res','medium_res','end_unknown','start_unknown','extent_unknown')" - }, - "obs_privacy_class_enum": { - "name": "obs_privacy_class_enum", - "value": "\"conditions\".\"observations\".\"privacy_class\" IN ('unknown','authoritative','aggregate','k_anon','dp_noised','crowd_pseudonym')" - }, - "obs_evidence_state_enum": { - "name": "obs_evidence_state_enum", - "value": "\"conditions\".\"observations\".\"evidence_state\" IS NULL OR \"conditions\".\"observations\".\"evidence_state\" IN ('self_reported','corroborated','externally_resolved','negated','expired')" - }, - "obs_tombstone_reason_enum": { - "name": "obs_tombstone_reason_enum", - "value": "\"conditions\".\"observations\".\"tombstone_reason\" IS NULL OR \"conditions\".\"observations\".\"tombstone_reason\" IN ('deleted_by_source','gdpr_erasure','retracted_as_wrong','expired','legal_takedown')" - } - }, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_observation": { - "name": "idx_report_evidence_observation", - "columns": [ - { - "expression": "observation_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"conditions\".\"report_evidence\".\"evidence_kind\" IN ('report','confirm','negate','official_match','reviewer_accept','reviewer_reject','expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "sensor_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_hourly": { - "name": "sensor_speed_hourly", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "speed_bins": { - "name": "speed_bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": true - }, - "speed_counts": { - "name": "speed_counts", - "type": "integer[]", - "primaryKey": false, - "notNull": true - }, - "finalized": { - "name": "finalized", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "idx_sensor_hourly_hour": { - "name": "idx_sensor_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_speed_hourly_sensor_key_hour_utc_pk": { - "name": "sensor_speed_hourly_sensor_key_hour_utc_pk", - "columns": [ - "sensor_key", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_sample": { - "name": "sensor_speed_sample", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_sample_key_bucket": { - "name": "idx_sensor_sample_key_bucket", - "columns": [ - { - "expression": "sensor_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_hour", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sensor_sample_observed": { - "name": "idx_sensor_sample_observed", - "columns": [ - { - "expression": "observed_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_sensor_sample_key_observed": { - "name": "uq_sensor_sample_key_observed", - "nullsNotDistinct": false, - "columns": [ - "sensor_key", - "observed_at" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.speed_rollup_progress": { - "name": "speed_rollup_progress", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "default": 1 - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "speed_rollup_progress_singleton": { - "name": "speed_rollup_progress_singleton", - "value": "\"conditions\".\"speed_rollup_progress\".\"id\" = 1" - } - }, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_subject": { - "name": "idx_sub_claim_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"conditions\".\"sub_claim\".\"claim_type\" IN ('confirm','negate','flag')" - } - }, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0034_snapshot.json b/packages/core/drizzle/meta/0034_snapshot.json deleted file mode 100644 index f18048f6d..000000000 --- a/packages/core/drizzle/meta/0034_snapshot.json +++ /dev/null @@ -1,3199 +0,0 @@ -{ - "id": "b13eae78-d26d-4293-b187-27f396f8726b", - "prevId": "bfab6bca-cafe-448a-94e3-7286048daa17", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "observation_revision": { - "name": "observation_revision", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "binding_queue_observation_id_observations_id_fk": { - "name": "binding_queue_observation_id_observations_id_fk", - "tableFrom": "binding_queue", - "tableTo": "observations", - "schemaTo": "conditions", - "columnsFrom": [ - "observation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "object_id": { - "name": "object_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_snapshot": { - "name": "payload_snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_object": { - "name": "idx_federation_outbox_object", - "columns": [ - { - "expression": "object_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_binding": { - "name": "observation_binding", - "schema": "conditions", - "columns": { - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'single'" - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observation_revision": { - "name": "observation_revision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_binding_status": { - "name": "idx_observation_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_binding_observation_id_observations_id_fk": { - "name": "observation_binding_observation_id_observations_id_fk", - "tableFrom": "observation_binding", - "tableTo": "observations", - "schemaTo": "conditions", - "columnsFrom": [ - "observation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_segment": { - "name": "observation_segment", - "schema": "conditions", - "columns": { - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_segment_segment": { - "name": "idx_observation_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_segment_observation_id_observations_id_fk": { - "name": "observation_segment_observation_id_observations_id_fk", - "tableFrom": "observation_segment", - "tableTo": "observations", - "schemaTo": "conditions", - "columnsFrom": [ - "observation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_segment_observation_id_seq_pk": { - "name": "observation_segment_observation_id_seq_pk", - "columns": [ - "observation_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observations": { - "name": "observations", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_format": { - "name": "source_format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity_source": { - "name": "severity_source", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "headline": { - "name": "headline", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "metric": { - "name": "metric", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "level": { - "name": "level", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "aggregation": { - "name": "aggregation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "subject": { - "name": "subject", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "attributes": { - "name": "attributes", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "schedule": { - "name": "schedule", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_forecast": { - "name": "is_forecast", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "related_ids": { - "name": "related_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "origin": { - "name": "origin", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "data_updated_at": { - "name": "data_updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "is_stale": { - "name": "is_stale", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "stale_after": { - "name": "stale_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "phenomenon_fingerprint": { - "name": "phenomenon_fingerprint", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "replaces": { - "name": "replaces", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "fuzziness": { - "name": "fuzziness", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'exact'" - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'unknown'" - }, - "k_anonymity": { - "name": "k_anonymity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "dp_epsilon": { - "name": "dp_epsilon", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "dp_delta": { - "name": "dp_delta", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "informed": { - "name": "informed", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "source_uri": { - "name": "source_uri", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_license": { - "name": "source_license", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_conditions_obs_geom": { - "name": "idx_conditions_obs_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_conditions_obs_domain": { - "name": "idx_conditions_obs_domain", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_dom_type": { - "name": "idx_conditions_obs_dom_type", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_severity": { - "name": "idx_conditions_obs_severity", - "columns": [ - { - "expression": "severity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_metric": { - "name": "idx_conditions_obs_metric", - "columns": [ - { - "expression": "metric", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_valid_to": { - "name": "idx_conditions_obs_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_expires": { - "name": "idx_conditions_obs_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_subject": { - "name": "idx_conditions_obs_subject", - "columns": [ - { - "expression": "subject", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_source": { - "name": "idx_conditions_obs_source", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_canonical": { - "name": "idx_conditions_obs_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_content_hash": { - "name": "idx_conditions_obs_content_hash", - "columns": [ - { - "expression": "content_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_phenomenon": { - "name": "idx_conditions_obs_phenomenon", - "columns": [ - { - "expression": "phenomenon_fingerprint", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_instance": { - "name": "idx_conditions_obs_instance", - "columns": [ - { - "expression": "instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_privacy": { - "name": "idx_conditions_obs_privacy", - "columns": [ - { - "expression": "privacy_class", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_evidence_state": { - "name": "idx_conditions_obs_evidence_state", - "columns": [ - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_flagged": { - "name": "idx_conditions_obs_flagged", - "columns": [ - { - "expression": "flagged_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observations\".\"flagged_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_corroborations": { - "name": "idx_conditions_obs_corroborations", - "columns": [ - { - "expression": "corroborations", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_replaces": { - "name": "idx_conditions_obs_replaces", - "columns": [ - { - "expression": "replaces", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "obs_confidence_score_range": { - "name": "obs_confidence_score_range", - "value": "\"conditions\".\"observations\".\"confidence_score\" IS NULL OR (\"conditions\".\"observations\".\"confidence_score\" >= 0 AND \"conditions\".\"observations\".\"confidence_score\" <= 1)" - }, - "obs_dp_epsilon_nonneg": { - "name": "obs_dp_epsilon_nonneg", - "value": "\"conditions\".\"observations\".\"dp_epsilon\" IS NULL OR \"conditions\".\"observations\".\"dp_epsilon\" >= 0" - }, - "obs_dp_delta_range": { - "name": "obs_dp_delta_range", - "value": "\"conditions\".\"observations\".\"dp_delta\" IS NULL OR (\"conditions\".\"observations\".\"dp_delta\" >= 0 AND \"conditions\".\"observations\".\"dp_delta\" < 1)" - }, - "obs_k_anonymity_positive": { - "name": "obs_k_anonymity_positive", - "value": "\"conditions\".\"observations\".\"k_anonymity\" IS NULL OR \"conditions\".\"observations\".\"k_anonymity\" > 0" - }, - "obs_severity_level_range": { - "name": "obs_severity_level_range", - "value": "\"conditions\".\"observations\".\"severity_level\" IS NULL OR (\"conditions\".\"observations\".\"severity_level\" >= 1 AND \"conditions\".\"observations\".\"severity_level\" <= 5)" - }, - "obs_fuzziness_enum": { - "name": "obs_fuzziness_enum", - "value": "\"conditions\".\"observations\".\"fuzziness\" IN ('exact','low_res','medium_res','end_unknown','start_unknown','extent_unknown')" - }, - "obs_privacy_class_enum": { - "name": "obs_privacy_class_enum", - "value": "\"conditions\".\"observations\".\"privacy_class\" IN ('unknown','authoritative','aggregate','k_anon','dp_noised','crowd_pseudonym')" - }, - "obs_evidence_state_enum": { - "name": "obs_evidence_state_enum", - "value": "\"conditions\".\"observations\".\"evidence_state\" IS NULL OR \"conditions\".\"observations\".\"evidence_state\" IN ('self_reported','corroborated','externally_resolved','negated','expired')" - }, - "obs_tombstone_reason_enum": { - "name": "obs_tombstone_reason_enum", - "value": "\"conditions\".\"observations\".\"tombstone_reason\" IS NULL OR \"conditions\".\"observations\".\"tombstone_reason\" IN ('deleted_by_source','gdpr_erasure','retracted_as_wrong','expired','legal_takedown')" - } - }, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_observation": { - "name": "idx_report_evidence_observation", - "columns": [ - { - "expression": "observation_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"conditions\".\"report_evidence\".\"evidence_kind\" IN ('report','confirm','negate','official_match','reviewer_accept','reviewer_reject','expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "sensor_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_hourly": { - "name": "sensor_speed_hourly", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "speed_bins": { - "name": "speed_bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": true - }, - "speed_counts": { - "name": "speed_counts", - "type": "integer[]", - "primaryKey": false, - "notNull": true - }, - "finalized": { - "name": "finalized", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "idx_sensor_hourly_hour": { - "name": "idx_sensor_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_speed_hourly_sensor_key_hour_utc_pk": { - "name": "sensor_speed_hourly_sensor_key_hour_utc_pk", - "columns": [ - "sensor_key", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_sample": { - "name": "sensor_speed_sample", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_sample_key_bucket": { - "name": "idx_sensor_sample_key_bucket", - "columns": [ - { - "expression": "sensor_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_hour", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sensor_sample_observed": { - "name": "idx_sensor_sample_observed", - "columns": [ - { - "expression": "observed_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_sensor_sample_key_observed": { - "name": "uq_sensor_sample_key_observed", - "nullsNotDistinct": false, - "columns": [ - "sensor_key", - "observed_at" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.speed_rollup_progress": { - "name": "speed_rollup_progress", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "default": 1 - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "speed_rollup_progress_singleton": { - "name": "speed_rollup_progress_singleton", - "value": "\"conditions\".\"speed_rollup_progress\".\"id\" = 1" - } - }, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_subject": { - "name": "idx_sub_claim_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"conditions\".\"sub_claim\".\"claim_type\" IN ('confirm','negate','flag')" - } - }, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0035_snapshot.json b/packages/core/drizzle/meta/0035_snapshot.json deleted file mode 100644 index 3cdd15e29..000000000 --- a/packages/core/drizzle/meta/0035_snapshot.json +++ /dev/null @@ -1,3199 +0,0 @@ -{ - "id": "b4ffb90c-b91c-4274-ab95-ba66f1b7075d", - "prevId": "b13eae78-d26d-4293-b187-27f396f8726b", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "observation_revision": { - "name": "observation_revision", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "binding_queue_observation_id_observations_id_fk": { - "name": "binding_queue_observation_id_observations_id_fk", - "tableFrom": "binding_queue", - "tableTo": "observations", - "schemaTo": "conditions", - "columnsFrom": [ - "observation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "object_id": { - "name": "object_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_snapshot": { - "name": "payload_snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_object": { - "name": "idx_federation_outbox_object", - "columns": [ - { - "expression": "object_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_binding": { - "name": "observation_binding", - "schema": "conditions", - "columns": { - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'single'" - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observation_revision": { - "name": "observation_revision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_binding_status": { - "name": "idx_observation_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_binding_observation_id_observations_id_fk": { - "name": "observation_binding_observation_id_observations_id_fk", - "tableFrom": "observation_binding", - "tableTo": "observations", - "schemaTo": "conditions", - "columnsFrom": [ - "observation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_segment": { - "name": "observation_segment", - "schema": "conditions", - "columns": { - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_segment_segment": { - "name": "idx_observation_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_segment_observation_id_observations_id_fk": { - "name": "observation_segment_observation_id_observations_id_fk", - "tableFrom": "observation_segment", - "tableTo": "observations", - "schemaTo": "conditions", - "columnsFrom": [ - "observation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_segment_observation_id_seq_pk": { - "name": "observation_segment_observation_id_seq_pk", - "columns": [ - "observation_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observations": { - "name": "observations", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_format": { - "name": "source_format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity_source": { - "name": "severity_source", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "headline": { - "name": "headline", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "metric": { - "name": "metric", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "level": { - "name": "level", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "aggregation": { - "name": "aggregation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "subject": { - "name": "subject", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "attributes": { - "name": "attributes", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "schedule": { - "name": "schedule", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_forecast": { - "name": "is_forecast", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "related_ids": { - "name": "related_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "origin": { - "name": "origin", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "data_updated_at": { - "name": "data_updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "is_stale": { - "name": "is_stale", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "stale_after": { - "name": "stale_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "phenomenon_fingerprint": { - "name": "phenomenon_fingerprint", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "replaces": { - "name": "replaces", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "fuzziness": { - "name": "fuzziness", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'exact'" - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'unknown'" - }, - "k_anonymity": { - "name": "k_anonymity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "dp_epsilon": { - "name": "dp_epsilon", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "dp_delta": { - "name": "dp_delta", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "informed": { - "name": "informed", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "source_uri": { - "name": "source_uri", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_license": { - "name": "source_license", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_conditions_obs_geom": { - "name": "idx_conditions_obs_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_conditions_obs_domain": { - "name": "idx_conditions_obs_domain", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_dom_type": { - "name": "idx_conditions_obs_dom_type", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_severity": { - "name": "idx_conditions_obs_severity", - "columns": [ - { - "expression": "severity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_metric": { - "name": "idx_conditions_obs_metric", - "columns": [ - { - "expression": "metric", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_valid_to": { - "name": "idx_conditions_obs_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_expires": { - "name": "idx_conditions_obs_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_subject": { - "name": "idx_conditions_obs_subject", - "columns": [ - { - "expression": "subject", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_source": { - "name": "idx_conditions_obs_source", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_canonical": { - "name": "idx_conditions_obs_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_content_hash": { - "name": "idx_conditions_obs_content_hash", - "columns": [ - { - "expression": "content_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_phenomenon": { - "name": "idx_conditions_obs_phenomenon", - "columns": [ - { - "expression": "phenomenon_fingerprint", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_instance": { - "name": "idx_conditions_obs_instance", - "columns": [ - { - "expression": "instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_privacy": { - "name": "idx_conditions_obs_privacy", - "columns": [ - { - "expression": "privacy_class", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_evidence_state": { - "name": "idx_conditions_obs_evidence_state", - "columns": [ - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_flagged": { - "name": "idx_conditions_obs_flagged", - "columns": [ - { - "expression": "flagged_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observations\".\"flagged_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_corroborations": { - "name": "idx_conditions_obs_corroborations", - "columns": [ - { - "expression": "corroborations", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_replaces": { - "name": "idx_conditions_obs_replaces", - "columns": [ - { - "expression": "replaces", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "obs_confidence_score_range": { - "name": "obs_confidence_score_range", - "value": "\"conditions\".\"observations\".\"confidence_score\" IS NULL OR (\"conditions\".\"observations\".\"confidence_score\" >= 0 AND \"conditions\".\"observations\".\"confidence_score\" <= 1)" - }, - "obs_dp_epsilon_nonneg": { - "name": "obs_dp_epsilon_nonneg", - "value": "\"conditions\".\"observations\".\"dp_epsilon\" IS NULL OR \"conditions\".\"observations\".\"dp_epsilon\" >= 0" - }, - "obs_dp_delta_range": { - "name": "obs_dp_delta_range", - "value": "\"conditions\".\"observations\".\"dp_delta\" IS NULL OR (\"conditions\".\"observations\".\"dp_delta\" >= 0 AND \"conditions\".\"observations\".\"dp_delta\" < 1)" - }, - "obs_k_anonymity_positive": { - "name": "obs_k_anonymity_positive", - "value": "\"conditions\".\"observations\".\"k_anonymity\" IS NULL OR \"conditions\".\"observations\".\"k_anonymity\" > 0" - }, - "obs_severity_level_range": { - "name": "obs_severity_level_range", - "value": "\"conditions\".\"observations\".\"severity_level\" IS NULL OR (\"conditions\".\"observations\".\"severity_level\" >= 1 AND \"conditions\".\"observations\".\"severity_level\" <= 5)" - }, - "obs_fuzziness_enum": { - "name": "obs_fuzziness_enum", - "value": "\"fuzziness\" IN ('exact', 'low_res', 'medium_res', 'end_unknown', 'start_unknown', 'extent_unknown')" - }, - "obs_privacy_class_enum": { - "name": "obs_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym', 'unknown')" - }, - "obs_evidence_state_enum": { - "name": "obs_evidence_state_enum", - "value": "\"conditions\".\"observations\".\"evidence_state\" IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - }, - "obs_tombstone_reason_enum": { - "name": "obs_tombstone_reason_enum", - "value": "\"conditions\".\"observations\".\"tombstone_reason\" IS NULL OR \"conditions\".\"observations\".\"tombstone_reason\" IN ('deleted_by_source','gdpr_erasure','retracted_as_wrong','expired','legal_takedown')" - } - }, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_observation": { - "name": "idx_report_evidence_observation", - "columns": [ - { - "expression": "observation_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"conditions\".\"report_evidence\".\"evidence_kind\" IN ('report','confirm','negate','official_match','reviewer_accept','reviewer_reject','expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "sensor_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_hourly": { - "name": "sensor_speed_hourly", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "speed_bins": { - "name": "speed_bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": true - }, - "speed_counts": { - "name": "speed_counts", - "type": "integer[]", - "primaryKey": false, - "notNull": true - }, - "finalized": { - "name": "finalized", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "idx_sensor_hourly_hour": { - "name": "idx_sensor_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_speed_hourly_sensor_key_hour_utc_pk": { - "name": "sensor_speed_hourly_sensor_key_hour_utc_pk", - "columns": [ - "sensor_key", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_sample": { - "name": "sensor_speed_sample", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_sample_key_bucket": { - "name": "idx_sensor_sample_key_bucket", - "columns": [ - { - "expression": "sensor_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_hour", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sensor_sample_observed": { - "name": "idx_sensor_sample_observed", - "columns": [ - { - "expression": "observed_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_sensor_sample_key_observed": { - "name": "uq_sensor_sample_key_observed", - "nullsNotDistinct": false, - "columns": [ - "sensor_key", - "observed_at" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.speed_rollup_progress": { - "name": "speed_rollup_progress", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "default": 1 - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "speed_rollup_progress_singleton": { - "name": "speed_rollup_progress_singleton", - "value": "\"conditions\".\"speed_rollup_progress\".\"id\" = 1" - } - }, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_subject": { - "name": "idx_sub_claim_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"conditions\".\"sub_claim\".\"claim_type\" IN ('confirm','negate','flag')" - } - }, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0036_snapshot.json b/packages/core/drizzle/meta/0036_snapshot.json deleted file mode 100644 index 0dca507cc..000000000 --- a/packages/core/drizzle/meta/0036_snapshot.json +++ /dev/null @@ -1,3373 +0,0 @@ -{ - "id": "778e802b-e1a2-4a30-8dcc-514fd3598c9f", - "prevId": "b4ffb90c-b91c-4274-ab95-ba66f1b7075d", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "observation_revision": { - "name": "observation_revision", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "binding_queue_observation_id_observations_id_fk": { - "name": "binding_queue_observation_id_observations_id_fk", - "tableFrom": "binding_queue", - "tableTo": "observations", - "schemaTo": "conditions", - "columnsFrom": [ - "observation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "object_id": { - "name": "object_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_snapshot": { - "name": "payload_snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_object": { - "name": "idx_federation_outbox_object", - "columns": [ - { - "expression": "object_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_binding": { - "name": "observation_binding", - "schema": "conditions", - "columns": { - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'single'" - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observation_revision": { - "name": "observation_revision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_binding_status": { - "name": "idx_observation_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_binding_observation_id_observations_id_fk": { - "name": "observation_binding_observation_id_observations_id_fk", - "tableFrom": "observation_binding", - "tableTo": "observations", - "schemaTo": "conditions", - "columnsFrom": [ - "observation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_segment": { - "name": "observation_segment", - "schema": "conditions", - "columns": { - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_segment_segment": { - "name": "idx_observation_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_segment_observation_id_observations_id_fk": { - "name": "observation_segment_observation_id_observations_id_fk", - "tableFrom": "observation_segment", - "tableTo": "observations", - "schemaTo": "conditions", - "columnsFrom": [ - "observation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_segment_observation_id_seq_pk": { - "name": "observation_segment_observation_id_seq_pk", - "columns": [ - "observation_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observations": { - "name": "observations", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_format": { - "name": "source_format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity_source": { - "name": "severity_source", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "headline": { - "name": "headline", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "metric": { - "name": "metric", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "level": { - "name": "level", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "aggregation": { - "name": "aggregation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "subject": { - "name": "subject", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "attributes": { - "name": "attributes", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "schedule": { - "name": "schedule", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_forecast": { - "name": "is_forecast", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "related_ids": { - "name": "related_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "origin": { - "name": "origin", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "data_updated_at": { - "name": "data_updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "is_stale": { - "name": "is_stale", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "stale_after": { - "name": "stale_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "phenomenon_fingerprint": { - "name": "phenomenon_fingerprint", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "replaces": { - "name": "replaces", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "fuzziness": { - "name": "fuzziness", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'exact'" - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'unknown'" - }, - "k_anonymity": { - "name": "k_anonymity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "dp_epsilon": { - "name": "dp_epsilon", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "dp_delta": { - "name": "dp_delta", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "informed": { - "name": "informed", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "source_uri": { - "name": "source_uri", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_license": { - "name": "source_license", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_conditions_obs_geom": { - "name": "idx_conditions_obs_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_conditions_obs_domain": { - "name": "idx_conditions_obs_domain", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_dom_type": { - "name": "idx_conditions_obs_dom_type", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_severity": { - "name": "idx_conditions_obs_severity", - "columns": [ - { - "expression": "severity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_metric": { - "name": "idx_conditions_obs_metric", - "columns": [ - { - "expression": "metric", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_valid_to": { - "name": "idx_conditions_obs_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_expires": { - "name": "idx_conditions_obs_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_subject": { - "name": "idx_conditions_obs_subject", - "columns": [ - { - "expression": "subject", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_source": { - "name": "idx_conditions_obs_source", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_canonical": { - "name": "idx_conditions_obs_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_content_hash": { - "name": "idx_conditions_obs_content_hash", - "columns": [ - { - "expression": "content_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_phenomenon": { - "name": "idx_conditions_obs_phenomenon", - "columns": [ - { - "expression": "phenomenon_fingerprint", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_instance": { - "name": "idx_conditions_obs_instance", - "columns": [ - { - "expression": "instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_privacy": { - "name": "idx_conditions_obs_privacy", - "columns": [ - { - "expression": "privacy_class", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_evidence_state": { - "name": "idx_conditions_obs_evidence_state", - "columns": [ - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_flagged": { - "name": "idx_conditions_obs_flagged", - "columns": [ - { - "expression": "flagged_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observations\".\"flagged_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_corroborations": { - "name": "idx_conditions_obs_corroborations", - "columns": [ - { - "expression": "corroborations", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_replaces": { - "name": "idx_conditions_obs_replaces", - "columns": [ - { - "expression": "replaces", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "obs_confidence_score_range": { - "name": "obs_confidence_score_range", - "value": "\"conditions\".\"observations\".\"confidence_score\" IS NULL OR (\"conditions\".\"observations\".\"confidence_score\" >= 0 AND \"conditions\".\"observations\".\"confidence_score\" <= 1)" - }, - "obs_dp_epsilon_nonneg": { - "name": "obs_dp_epsilon_nonneg", - "value": "\"conditions\".\"observations\".\"dp_epsilon\" IS NULL OR \"conditions\".\"observations\".\"dp_epsilon\" >= 0" - }, - "obs_dp_delta_range": { - "name": "obs_dp_delta_range", - "value": "\"conditions\".\"observations\".\"dp_delta\" IS NULL OR (\"conditions\".\"observations\".\"dp_delta\" >= 0 AND \"conditions\".\"observations\".\"dp_delta\" < 1)" - }, - "obs_k_anonymity_positive": { - "name": "obs_k_anonymity_positive", - "value": "\"conditions\".\"observations\".\"k_anonymity\" IS NULL OR \"conditions\".\"observations\".\"k_anonymity\" > 0" - }, - "obs_severity_level_range": { - "name": "obs_severity_level_range", - "value": "\"conditions\".\"observations\".\"severity_level\" IS NULL OR (\"conditions\".\"observations\".\"severity_level\" >= 1 AND \"conditions\".\"observations\".\"severity_level\" <= 5)" - }, - "obs_fuzziness_enum": { - "name": "obs_fuzziness_enum", - "value": "\"fuzziness\" IN ('exact', 'low_res', 'medium_res', 'end_unknown', 'start_unknown', 'extent_unknown')" - }, - "obs_privacy_class_enum": { - "name": "obs_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym', 'unknown')" - }, - "obs_evidence_state_enum": { - "name": "obs_evidence_state_enum", - "value": "\"conditions\".\"observations\".\"evidence_state\" IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - }, - "obs_tombstone_reason_enum": { - "name": "obs_tombstone_reason_enum", - "value": "\"conditions\".\"observations\".\"tombstone_reason\" IS NULL OR \"conditions\".\"observations\".\"tombstone_reason\" IN ('deleted_by_source','gdpr_erasure','retracted_as_wrong','expired','legal_takedown')" - } - }, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_observation": { - "name": "idx_report_evidence_observation", - "columns": [ - { - "expression": "observation_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"conditions\".\"report_evidence\".\"evidence_kind\" IN ('report','confirm','negate','official_match','reviewer_accept','reviewer_reject','expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "sensor_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_hourly": { - "name": "sensor_speed_hourly", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "speed_bins": { - "name": "speed_bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": true - }, - "speed_counts": { - "name": "speed_counts", - "type": "integer[]", - "primaryKey": false, - "notNull": true - }, - "finalized": { - "name": "finalized", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "idx_sensor_hourly_hour": { - "name": "idx_sensor_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_speed_hourly_sensor_key_hour_utc_pk": { - "name": "sensor_speed_hourly_sensor_key_hour_utc_pk", - "columns": [ - "sensor_key", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_sample": { - "name": "sensor_speed_sample", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_sample_key_bucket": { - "name": "idx_sensor_sample_key_bucket", - "columns": [ - { - "expression": "sensor_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_hour", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sensor_sample_observed": { - "name": "idx_sensor_sample_observed", - "columns": [ - { - "expression": "observed_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_sensor_sample_key_observed": { - "name": "uq_sensor_sample_key_observed", - "nullsNotDistinct": false, - "columns": [ - "sensor_key", - "observed_at" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.speed_rollup_progress": { - "name": "speed_rollup_progress", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "default": 1 - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "speed_rollup_progress_singleton": { - "name": "speed_rollup_progress_singleton", - "value": "\"conditions\".\"speed_rollup_progress\".\"id\" = 1" - } - }, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_subject": { - "name": "idx_sub_claim_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"conditions\".\"sub_claim\".\"claim_type\" IN ('confirm','negate','flag')" - } - }, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "produces": { - "name": "produces", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - }, - "source_produces_enum": { - "name": "source_produces_enum", - "value": "\"conditions\".\"source\".\"produces\" IN ('events', 'flow')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0037_snapshot.json b/packages/core/drizzle/meta/0037_snapshot.json deleted file mode 100644 index df10c2a8a..000000000 --- a/packages/core/drizzle/meta/0037_snapshot.json +++ /dev/null @@ -1,5199 +0,0 @@ -{ - "id": "bd144022-57bc-4670-9f8b-d47b7e880278", - "prevId": "778e802b-e1a2-4a30-8dcc-514fd3598c9f", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "tableTo": "offer", - "schemaTo": "conditions", - "columnsFrom": [ - "offer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "observation_revision": { - "name": "observation_revision", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "binding_queue_observation_id_observations_id_fk": { - "name": "binding_queue_observation_id_observations_id_fk", - "tableFrom": "binding_queue", - "tableTo": "observations", - "schemaTo": "conditions", - "columnsFrom": [ - "observation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "object_id": { - "name": "object_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_snapshot": { - "name": "payload_snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_object": { - "name": "idx_federation_outbox_object", - "columns": [ - { - "expression": "object_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_binding": { - "name": "observation_binding", - "schema": "conditions", - "columns": { - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'single'" - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observation_revision": { - "name": "observation_revision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_binding_status": { - "name": "idx_observation_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_binding_observation_id_observations_id_fk": { - "name": "observation_binding_observation_id_observations_id_fk", - "tableFrom": "observation_binding", - "tableTo": "observations", - "schemaTo": "conditions", - "columnsFrom": [ - "observation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_segment": { - "name": "observation_segment", - "schema": "conditions", - "columns": { - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_segment_segment": { - "name": "idx_observation_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_segment_observation_id_observations_id_fk": { - "name": "observation_segment_observation_id_observations_id_fk", - "tableFrom": "observation_segment", - "tableTo": "observations", - "schemaTo": "conditions", - "columnsFrom": [ - "observation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_segment_observation_id_seq_pk": { - "name": "observation_segment_observation_id_seq_pk", - "columns": [ - "observation_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observations": { - "name": "observations", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_format": { - "name": "source_format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity_source": { - "name": "severity_source", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "headline": { - "name": "headline", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "metric": { - "name": "metric", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "level": { - "name": "level", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "aggregation": { - "name": "aggregation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "subject": { - "name": "subject", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "attributes": { - "name": "attributes", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "schedule": { - "name": "schedule", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_forecast": { - "name": "is_forecast", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "related_ids": { - "name": "related_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "origin": { - "name": "origin", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "data_updated_at": { - "name": "data_updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "is_stale": { - "name": "is_stale", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "stale_after": { - "name": "stale_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "phenomenon_fingerprint": { - "name": "phenomenon_fingerprint", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "replaces": { - "name": "replaces", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "fuzziness": { - "name": "fuzziness", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'exact'" - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'unknown'" - }, - "k_anonymity": { - "name": "k_anonymity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "dp_epsilon": { - "name": "dp_epsilon", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "dp_delta": { - "name": "dp_delta", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "informed": { - "name": "informed", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "source_uri": { - "name": "source_uri", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_license": { - "name": "source_license", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_conditions_obs_geom": { - "name": "idx_conditions_obs_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_conditions_obs_domain": { - "name": "idx_conditions_obs_domain", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_dom_type": { - "name": "idx_conditions_obs_dom_type", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_severity": { - "name": "idx_conditions_obs_severity", - "columns": [ - { - "expression": "severity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_metric": { - "name": "idx_conditions_obs_metric", - "columns": [ - { - "expression": "metric", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_valid_to": { - "name": "idx_conditions_obs_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_expires": { - "name": "idx_conditions_obs_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_subject": { - "name": "idx_conditions_obs_subject", - "columns": [ - { - "expression": "subject", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_source": { - "name": "idx_conditions_obs_source", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_canonical": { - "name": "idx_conditions_obs_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_content_hash": { - "name": "idx_conditions_obs_content_hash", - "columns": [ - { - "expression": "content_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_phenomenon": { - "name": "idx_conditions_obs_phenomenon", - "columns": [ - { - "expression": "phenomenon_fingerprint", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_instance": { - "name": "idx_conditions_obs_instance", - "columns": [ - { - "expression": "instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_privacy": { - "name": "idx_conditions_obs_privacy", - "columns": [ - { - "expression": "privacy_class", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_evidence_state": { - "name": "idx_conditions_obs_evidence_state", - "columns": [ - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_flagged": { - "name": "idx_conditions_obs_flagged", - "columns": [ - { - "expression": "flagged_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observations\".\"flagged_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_corroborations": { - "name": "idx_conditions_obs_corroborations", - "columns": [ - { - "expression": "corroborations", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_replaces": { - "name": "idx_conditions_obs_replaces", - "columns": [ - { - "expression": "replaces", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "obs_confidence_score_range": { - "name": "obs_confidence_score_range", - "value": "\"conditions\".\"observations\".\"confidence_score\" IS NULL OR (\"conditions\".\"observations\".\"confidence_score\" >= 0 AND \"conditions\".\"observations\".\"confidence_score\" <= 1)" - }, - "obs_dp_epsilon_nonneg": { - "name": "obs_dp_epsilon_nonneg", - "value": "\"conditions\".\"observations\".\"dp_epsilon\" IS NULL OR \"conditions\".\"observations\".\"dp_epsilon\" >= 0" - }, - "obs_dp_delta_range": { - "name": "obs_dp_delta_range", - "value": "\"conditions\".\"observations\".\"dp_delta\" IS NULL OR (\"conditions\".\"observations\".\"dp_delta\" >= 0 AND \"conditions\".\"observations\".\"dp_delta\" < 1)" - }, - "obs_k_anonymity_positive": { - "name": "obs_k_anonymity_positive", - "value": "\"conditions\".\"observations\".\"k_anonymity\" IS NULL OR \"conditions\".\"observations\".\"k_anonymity\" > 0" - }, - "obs_severity_level_range": { - "name": "obs_severity_level_range", - "value": "\"conditions\".\"observations\".\"severity_level\" IS NULL OR (\"conditions\".\"observations\".\"severity_level\" >= 1 AND \"conditions\".\"observations\".\"severity_level\" <= 5)" - }, - "obs_fuzziness_enum": { - "name": "obs_fuzziness_enum", - "value": "\"fuzziness\" IN ('exact', 'low_res', 'medium_res', 'end_unknown', 'start_unknown', 'extent_unknown')" - }, - "obs_privacy_class_enum": { - "name": "obs_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym', 'unknown')" - }, - "obs_evidence_state_enum": { - "name": "obs_evidence_state_enum", - "value": "\"conditions\".\"observations\".\"evidence_state\" IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - }, - "obs_tombstone_reason_enum": { - "name": "obs_tombstone_reason_enum", - "value": "\"conditions\".\"observations\".\"tombstone_reason\" IS NULL OR \"conditions\".\"observations\".\"tombstone_reason\" IN ('deleted_by_source','gdpr_erasure','retracted_as_wrong','expired','legal_takedown')" - } - }, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_observation": { - "name": "idx_report_evidence_observation", - "columns": [ - { - "expression": "observation_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"conditions\".\"report_evidence\".\"evidence_kind\" IN ('report','confirm','negate','official_match','reviewer_accept','reviewer_reject','expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "sensor_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_hourly": { - "name": "sensor_speed_hourly", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "speed_bins": { - "name": "speed_bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": true - }, - "speed_counts": { - "name": "speed_counts", - "type": "integer[]", - "primaryKey": false, - "notNull": true - }, - "finalized": { - "name": "finalized", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "idx_sensor_hourly_hour": { - "name": "idx_sensor_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_speed_hourly_sensor_key_hour_utc_pk": { - "name": "sensor_speed_hourly_sensor_key_hour_utc_pk", - "columns": [ - "sensor_key", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_sample": { - "name": "sensor_speed_sample", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_sample_key_bucket": { - "name": "idx_sensor_sample_key_bucket", - "columns": [ - { - "expression": "sensor_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_hour", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sensor_sample_observed": { - "name": "idx_sensor_sample_observed", - "columns": [ - { - "expression": "observed_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_sensor_sample_key_observed": { - "name": "uq_sensor_sample_key_observed", - "nullsNotDistinct": false, - "columns": [ - "sensor_key", - "observed_at" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.speed_rollup_progress": { - "name": "speed_rollup_progress", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "default": 1 - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "speed_rollup_progress_singleton": { - "name": "speed_rollup_progress_singleton", - "value": "\"conditions\".\"speed_rollup_progress\".\"id\" = 1" - } - }, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_subject": { - "name": "idx_sub_claim_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"conditions\".\"sub_claim\".\"claim_type\" IN ('confirm','negate','flag')" - } - }, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "produces": { - "name": "produces", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - }, - "source_produces_enum": { - "name": "source_produces_enum", - "value": "\"conditions\".\"source\".\"produces\" IN ('events', 'flow')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0038_snapshot.json b/packages/core/drizzle/meta/0038_snapshot.json deleted file mode 100644 index 00551232e..000000000 --- a/packages/core/drizzle/meta/0038_snapshot.json +++ /dev/null @@ -1,5704 +0,0 @@ -{ - "id": "0db154b7-ac58-4bea-a707-aa596bcd1b36", - "prevId": "bd144022-57bc-4670-9f8b-d47b7e880278", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_observation_latest_property": { - "name": "idx_observation_latest_property", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "nullsNotDistinct": false, - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ] - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "tableTo": "offer", - "schemaTo": "conditions", - "columnsFrom": [ - "offer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "observation_revision": { - "name": "observation_revision", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "binding_queue_observation_id_observations_id_fk": { - "name": "binding_queue_observation_id_observations_id_fk", - "tableFrom": "binding_queue", - "tableTo": "observations", - "schemaTo": "conditions", - "columnsFrom": [ - "observation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "object_id": { - "name": "object_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_snapshot": { - "name": "payload_snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_object": { - "name": "idx_federation_outbox_object", - "columns": [ - { - "expression": "object_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_binding": { - "name": "observation_binding", - "schema": "conditions", - "columns": { - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'single'" - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observation_revision": { - "name": "observation_revision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_binding_status": { - "name": "idx_observation_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_binding_observation_id_observations_id_fk": { - "name": "observation_binding_observation_id_observations_id_fk", - "tableFrom": "observation_binding", - "tableTo": "observations", - "schemaTo": "conditions", - "columnsFrom": [ - "observation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_segment": { - "name": "observation_segment", - "schema": "conditions", - "columns": { - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_segment_segment": { - "name": "idx_observation_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_segment_observation_id_observations_id_fk": { - "name": "observation_segment_observation_id_observations_id_fk", - "tableFrom": "observation_segment", - "tableTo": "observations", - "schemaTo": "conditions", - "columnsFrom": [ - "observation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_segment_observation_id_seq_pk": { - "name": "observation_segment_observation_id_seq_pk", - "columns": [ - "observation_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observations": { - "name": "observations", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_format": { - "name": "source_format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity_source": { - "name": "severity_source", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "headline": { - "name": "headline", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "metric": { - "name": "metric", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "level": { - "name": "level", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "aggregation": { - "name": "aggregation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "subject": { - "name": "subject", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "attributes": { - "name": "attributes", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "schedule": { - "name": "schedule", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_forecast": { - "name": "is_forecast", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "related_ids": { - "name": "related_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "origin": { - "name": "origin", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "data_updated_at": { - "name": "data_updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "is_stale": { - "name": "is_stale", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "stale_after": { - "name": "stale_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "phenomenon_fingerprint": { - "name": "phenomenon_fingerprint", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "replaces": { - "name": "replaces", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "fuzziness": { - "name": "fuzziness", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'exact'" - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'unknown'" - }, - "k_anonymity": { - "name": "k_anonymity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "dp_epsilon": { - "name": "dp_epsilon", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "dp_delta": { - "name": "dp_delta", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "informed": { - "name": "informed", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "source_uri": { - "name": "source_uri", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_license": { - "name": "source_license", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_conditions_obs_geom": { - "name": "idx_conditions_obs_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_conditions_obs_domain": { - "name": "idx_conditions_obs_domain", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_dom_type": { - "name": "idx_conditions_obs_dom_type", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_severity": { - "name": "idx_conditions_obs_severity", - "columns": [ - { - "expression": "severity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_metric": { - "name": "idx_conditions_obs_metric", - "columns": [ - { - "expression": "metric", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_valid_to": { - "name": "idx_conditions_obs_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_expires": { - "name": "idx_conditions_obs_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_subject": { - "name": "idx_conditions_obs_subject", - "columns": [ - { - "expression": "subject", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_source": { - "name": "idx_conditions_obs_source", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_canonical": { - "name": "idx_conditions_obs_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_content_hash": { - "name": "idx_conditions_obs_content_hash", - "columns": [ - { - "expression": "content_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_phenomenon": { - "name": "idx_conditions_obs_phenomenon", - "columns": [ - { - "expression": "phenomenon_fingerprint", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_instance": { - "name": "idx_conditions_obs_instance", - "columns": [ - { - "expression": "instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_privacy": { - "name": "idx_conditions_obs_privacy", - "columns": [ - { - "expression": "privacy_class", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_evidence_state": { - "name": "idx_conditions_obs_evidence_state", - "columns": [ - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_flagged": { - "name": "idx_conditions_obs_flagged", - "columns": [ - { - "expression": "flagged_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observations\".\"flagged_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_corroborations": { - "name": "idx_conditions_obs_corroborations", - "columns": [ - { - "expression": "corroborations", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_replaces": { - "name": "idx_conditions_obs_replaces", - "columns": [ - { - "expression": "replaces", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "obs_confidence_score_range": { - "name": "obs_confidence_score_range", - "value": "\"conditions\".\"observations\".\"confidence_score\" IS NULL OR (\"conditions\".\"observations\".\"confidence_score\" >= 0 AND \"conditions\".\"observations\".\"confidence_score\" <= 1)" - }, - "obs_dp_epsilon_nonneg": { - "name": "obs_dp_epsilon_nonneg", - "value": "\"conditions\".\"observations\".\"dp_epsilon\" IS NULL OR \"conditions\".\"observations\".\"dp_epsilon\" >= 0" - }, - "obs_dp_delta_range": { - "name": "obs_dp_delta_range", - "value": "\"conditions\".\"observations\".\"dp_delta\" IS NULL OR (\"conditions\".\"observations\".\"dp_delta\" >= 0 AND \"conditions\".\"observations\".\"dp_delta\" < 1)" - }, - "obs_k_anonymity_positive": { - "name": "obs_k_anonymity_positive", - "value": "\"conditions\".\"observations\".\"k_anonymity\" IS NULL OR \"conditions\".\"observations\".\"k_anonymity\" > 0" - }, - "obs_severity_level_range": { - "name": "obs_severity_level_range", - "value": "\"conditions\".\"observations\".\"severity_level\" IS NULL OR (\"conditions\".\"observations\".\"severity_level\" >= 1 AND \"conditions\".\"observations\".\"severity_level\" <= 5)" - }, - "obs_fuzziness_enum": { - "name": "obs_fuzziness_enum", - "value": "\"fuzziness\" IN ('exact', 'low_res', 'medium_res', 'end_unknown', 'start_unknown', 'extent_unknown')" - }, - "obs_privacy_class_enum": { - "name": "obs_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym', 'unknown')" - }, - "obs_evidence_state_enum": { - "name": "obs_evidence_state_enum", - "value": "\"conditions\".\"observations\".\"evidence_state\" IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - }, - "obs_tombstone_reason_enum": { - "name": "obs_tombstone_reason_enum", - "value": "\"conditions\".\"observations\".\"tombstone_reason\" IS NULL OR \"conditions\".\"observations\".\"tombstone_reason\" IN ('deleted_by_source','gdpr_erasure','retracted_as_wrong','expired','legal_takedown')" - } - }, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_observation": { - "name": "idx_report_evidence_observation", - "columns": [ - { - "expression": "observation_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"conditions\".\"report_evidence\".\"evidence_kind\" IN ('report','confirm','negate','official_match','reviewer_accept','reviewer_reject','expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "sensor_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_hourly": { - "name": "sensor_speed_hourly", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "speed_bins": { - "name": "speed_bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": true - }, - "speed_counts": { - "name": "speed_counts", - "type": "integer[]", - "primaryKey": false, - "notNull": true - }, - "finalized": { - "name": "finalized", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "idx_sensor_hourly_hour": { - "name": "idx_sensor_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_speed_hourly_sensor_key_hour_utc_pk": { - "name": "sensor_speed_hourly_sensor_key_hour_utc_pk", - "columns": [ - "sensor_key", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_sample": { - "name": "sensor_speed_sample", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_sample_key_bucket": { - "name": "idx_sensor_sample_key_bucket", - "columns": [ - { - "expression": "sensor_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_hour", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sensor_sample_observed": { - "name": "idx_sensor_sample_observed", - "columns": [ - { - "expression": "observed_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_sensor_sample_key_observed": { - "name": "uq_sensor_sample_key_observed", - "nullsNotDistinct": false, - "columns": [ - "sensor_key", - "observed_at" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.speed_rollup_progress": { - "name": "speed_rollup_progress", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "default": 1 - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "speed_rollup_progress_singleton": { - "name": "speed_rollup_progress_singleton", - "value": "\"conditions\".\"speed_rollup_progress\".\"id\" = 1" - } - }, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_subject": { - "name": "idx_sub_claim_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"conditions\".\"sub_claim\".\"claim_type\" IN ('confirm','negate','flag')" - } - }, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "produces": { - "name": "produces", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - }, - "source_produces_enum": { - "name": "source_produces_enum", - "value": "\"conditions\".\"source\".\"produces\" IN ('events', 'flow')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0039_snapshot.json b/packages/core/drizzle/meta/0039_snapshot.json deleted file mode 100644 index 15d413d56..000000000 --- a/packages/core/drizzle/meta/0039_snapshot.json +++ /dev/null @@ -1,5704 +0,0 @@ -{ - "id": "8da0294c-fb48-407b-86fa-ed8b6cb27caa", - "prevId": "0db154b7-ac58-4bea-a707-aa596bcd1b36", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_observation_latest_property": { - "name": "idx_observation_latest_property", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "columnsFrom": [ - "series_id" - ], - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsTo": [ - "series_id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "columnsFrom": [ - "series_id" - ], - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsTo": [ - "series_id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gin", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "gin", - "concurrently": false - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "columnsFrom": [ - "feature_id" - ], - "tableTo": "feature", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "columnsFrom": [ - "feature_id" - ], - "tableTo": "feature", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "columnsFrom": [ - "offer_id" - ], - "tableTo": "offer", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "columnsFrom": [ - "situation_id" - ], - "tableTo": "situation", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "columnsFrom": [ - "situation_id" - ], - "tableTo": "situation", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "observation_revision": { - "name": "observation_revision", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "binding_queue_observation_id_observations_id_fk": { - "name": "binding_queue_observation_id_observations_id_fk", - "tableFrom": "binding_queue", - "columnsFrom": [ - "observation_id" - ], - "tableTo": "observations", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "object_id": { - "name": "object_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_snapshot": { - "name": "payload_snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_object": { - "name": "idx_federation_outbox_object", - "columns": [ - { - "expression": "object_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_binding": { - "name": "observation_binding", - "schema": "conditions", - "columns": { - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'single'" - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observation_revision": { - "name": "observation_revision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_binding_status": { - "name": "idx_observation_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "observation_binding_observation_id_observations_id_fk": { - "name": "observation_binding_observation_id_observations_id_fk", - "tableFrom": "observation_binding", - "columnsFrom": [ - "observation_id" - ], - "tableTo": "observations", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_segment": { - "name": "observation_segment", - "schema": "conditions", - "columns": { - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_segment_segment": { - "name": "idx_observation_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "observation_segment_observation_id_observations_id_fk": { - "name": "observation_segment_observation_id_observations_id_fk", - "tableFrom": "observation_segment", - "columnsFrom": [ - "observation_id" - ], - "tableTo": "observations", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "observation_segment_observation_id_seq_pk": { - "name": "observation_segment_observation_id_seq_pk", - "columns": [ - "observation_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observations": { - "name": "observations", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_format": { - "name": "source_format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity_source": { - "name": "severity_source", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "headline": { - "name": "headline", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "metric": { - "name": "metric", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "level": { - "name": "level", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "aggregation": { - "name": "aggregation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "subject": { - "name": "subject", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "attributes": { - "name": "attributes", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "schedule": { - "name": "schedule", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_forecast": { - "name": "is_forecast", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "related_ids": { - "name": "related_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "origin": { - "name": "origin", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "data_updated_at": { - "name": "data_updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "is_stale": { - "name": "is_stale", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "stale_after": { - "name": "stale_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "phenomenon_fingerprint": { - "name": "phenomenon_fingerprint", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "replaces": { - "name": "replaces", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "fuzziness": { - "name": "fuzziness", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'exact'" - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'unknown'" - }, - "k_anonymity": { - "name": "k_anonymity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "dp_epsilon": { - "name": "dp_epsilon", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "dp_delta": { - "name": "dp_delta", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "informed": { - "name": "informed", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "source_uri": { - "name": "source_uri", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_license": { - "name": "source_license", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_conditions_obs_geom": { - "name": "idx_conditions_obs_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_conditions_obs_domain": { - "name": "idx_conditions_obs_domain", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_dom_type": { - "name": "idx_conditions_obs_dom_type", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_severity": { - "name": "idx_conditions_obs_severity", - "columns": [ - { - "expression": "severity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_metric": { - "name": "idx_conditions_obs_metric", - "columns": [ - { - "expression": "metric", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_valid_to": { - "name": "idx_conditions_obs_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_expires": { - "name": "idx_conditions_obs_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_subject": { - "name": "idx_conditions_obs_subject", - "columns": [ - { - "expression": "subject", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gin", - "concurrently": false - }, - "idx_conditions_obs_source": { - "name": "idx_conditions_obs_source", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_canonical": { - "name": "idx_conditions_obs_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_content_hash": { - "name": "idx_conditions_obs_content_hash", - "columns": [ - { - "expression": "content_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_phenomenon": { - "name": "idx_conditions_obs_phenomenon", - "columns": [ - { - "expression": "phenomenon_fingerprint", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_instance": { - "name": "idx_conditions_obs_instance", - "columns": [ - { - "expression": "instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_privacy": { - "name": "idx_conditions_obs_privacy", - "columns": [ - { - "expression": "privacy_class", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_evidence_state": { - "name": "idx_conditions_obs_evidence_state", - "columns": [ - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_flagged": { - "name": "idx_conditions_obs_flagged", - "columns": [ - { - "expression": "flagged_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"observations\".\"flagged_at\" IS NOT NULL", - "concurrently": false - }, - "idx_conditions_obs_corroborations": { - "name": "idx_conditions_obs_corroborations", - "columns": [ - { - "expression": "corroborations", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gin", - "concurrently": false - }, - "idx_conditions_obs_replaces": { - "name": "idx_conditions_obs_replaces", - "columns": [ - { - "expression": "replaces", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gin", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "obs_confidence_score_range": { - "name": "obs_confidence_score_range", - "value": "\"conditions\".\"observations\".\"confidence_score\" IS NULL OR (\"conditions\".\"observations\".\"confidence_score\" >= 0 AND \"conditions\".\"observations\".\"confidence_score\" <= 1)" - }, - "obs_dp_epsilon_nonneg": { - "name": "obs_dp_epsilon_nonneg", - "value": "\"conditions\".\"observations\".\"dp_epsilon\" IS NULL OR \"conditions\".\"observations\".\"dp_epsilon\" >= 0" - }, - "obs_dp_delta_range": { - "name": "obs_dp_delta_range", - "value": "\"conditions\".\"observations\".\"dp_delta\" IS NULL OR (\"conditions\".\"observations\".\"dp_delta\" >= 0 AND \"conditions\".\"observations\".\"dp_delta\" < 1)" - }, - "obs_k_anonymity_positive": { - "name": "obs_k_anonymity_positive", - "value": "\"conditions\".\"observations\".\"k_anonymity\" IS NULL OR \"conditions\".\"observations\".\"k_anonymity\" > 0" - }, - "obs_severity_level_range": { - "name": "obs_severity_level_range", - "value": "\"conditions\".\"observations\".\"severity_level\" IS NULL OR (\"conditions\".\"observations\".\"severity_level\" >= 1 AND \"conditions\".\"observations\".\"severity_level\" <= 5)" - }, - "obs_fuzziness_enum": { - "name": "obs_fuzziness_enum", - "value": "\"fuzziness\" IN ('exact', 'low_res', 'medium_res', 'end_unknown', 'start_unknown', 'extent_unknown')" - }, - "obs_privacy_class_enum": { - "name": "obs_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym', 'unknown')" - }, - "obs_evidence_state_enum": { - "name": "obs_evidence_state_enum", - "value": "\"conditions\".\"observations\".\"evidence_state\" IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - }, - "obs_tombstone_reason_enum": { - "name": "obs_tombstone_reason_enum", - "value": "\"conditions\".\"observations\".\"tombstone_reason\" IS NULL OR \"conditions\".\"observations\".\"tombstone_reason\" IN ('deleted_by_source','gdpr_erasure','retracted_as_wrong','expired','legal_takedown')" - } - }, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_observation": { - "name": "idx_report_evidence_observation", - "columns": [ - { - "expression": "observation_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"conditions\".\"report_evidence\".\"evidence_kind\" IN ('report','confirm','negate','official_match','reviewer_accept','reviewer_reject','expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "sensor_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_hourly": { - "name": "sensor_speed_hourly", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "speed_bins": { - "name": "speed_bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": true - }, - "speed_counts": { - "name": "speed_counts", - "type": "integer[]", - "primaryKey": false, - "notNull": true - }, - "finalized": { - "name": "finalized", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "idx_sensor_hourly_hour": { - "name": "idx_sensor_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_speed_hourly_sensor_key_hour_utc_pk": { - "name": "sensor_speed_hourly_sensor_key_hour_utc_pk", - "columns": [ - "sensor_key", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_sample": { - "name": "sensor_speed_sample", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_sample_key_bucket": { - "name": "idx_sensor_sample_key_bucket", - "columns": [ - { - "expression": "sensor_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_hour", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_sensor_sample_observed": { - "name": "idx_sensor_sample_observed", - "columns": [ - { - "expression": "observed_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_sensor_sample_key_observed": { - "name": "uq_sensor_sample_key_observed", - "columns": [ - "sensor_key", - "observed_at" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.speed_rollup_progress": { - "name": "speed_rollup_progress", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "default": 1 - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "speed_rollup_progress_singleton": { - "name": "speed_rollup_progress_singleton", - "value": "\"conditions\".\"speed_rollup_progress\".\"id\" = 1" - } - }, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_sub_claim_subject": { - "name": "idx_sub_claim_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"conditions\".\"sub_claim\".\"claim_type\" IN ('confirm','negate','flag')" - } - }, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "produces": { - "name": "produces", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - }, - "source_produces_enum": { - "name": "source_produces_enum", - "value": "\"conditions\".\"source\".\"produces\" IN ('events', 'flow')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "views": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0040_snapshot.json b/packages/core/drizzle/meta/0040_snapshot.json deleted file mode 100644 index a5e64cb2b..000000000 --- a/packages/core/drizzle/meta/0040_snapshot.json +++ /dev/null @@ -1,5887 +0,0 @@ -{ - "id": "c31f4778-84b5-4117-87db-90207b210220", - "prevId": "8da0294c-fb48-407b-86fa-ed8b6cb27caa", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_observation_latest_property": { - "name": "idx_observation_latest_property", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "nullsNotDistinct": false, - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ] - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "tableTo": "offer", - "schemaTo": "conditions", - "columnsFrom": [ - "offer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "observation_revision": { - "name": "observation_revision", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "binding_queue_observation_id_observations_id_fk": { - "name": "binding_queue_observation_id_observations_id_fk", - "tableFrom": "binding_queue", - "tableTo": "observations", - "schemaTo": "conditions", - "columnsFrom": [ - "observation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "object_id": { - "name": "object_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_snapshot": { - "name": "payload_snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_object": { - "name": "idx_federation_outbox_object", - "columns": [ - { - "expression": "object_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_binding": { - "name": "observation_binding", - "schema": "conditions", - "columns": { - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'single'" - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observation_revision": { - "name": "observation_revision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_binding_status": { - "name": "idx_observation_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_binding_observation_id_observations_id_fk": { - "name": "observation_binding_observation_id_observations_id_fk", - "tableFrom": "observation_binding", - "tableTo": "observations", - "schemaTo": "conditions", - "columnsFrom": [ - "observation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_segment": { - "name": "observation_segment", - "schema": "conditions", - "columns": { - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_segment_segment": { - "name": "idx_observation_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_segment_observation_id_observations_id_fk": { - "name": "observation_segment_observation_id_observations_id_fk", - "tableFrom": "observation_segment", - "tableTo": "observations", - "schemaTo": "conditions", - "columnsFrom": [ - "observation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_segment_observation_id_seq_pk": { - "name": "observation_segment_observation_id_seq_pk", - "columns": [ - "observation_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observations": { - "name": "observations", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_format": { - "name": "source_format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity_source": { - "name": "severity_source", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "headline": { - "name": "headline", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "metric": { - "name": "metric", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "level": { - "name": "level", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "aggregation": { - "name": "aggregation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "subject": { - "name": "subject", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "attributes": { - "name": "attributes", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "schedule": { - "name": "schedule", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_forecast": { - "name": "is_forecast", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "related_ids": { - "name": "related_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "origin": { - "name": "origin", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "data_updated_at": { - "name": "data_updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "is_stale": { - "name": "is_stale", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "stale_after": { - "name": "stale_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "phenomenon_fingerprint": { - "name": "phenomenon_fingerprint", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "replaces": { - "name": "replaces", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "fuzziness": { - "name": "fuzziness", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'exact'" - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'unknown'" - }, - "k_anonymity": { - "name": "k_anonymity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "dp_epsilon": { - "name": "dp_epsilon", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "dp_delta": { - "name": "dp_delta", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "informed": { - "name": "informed", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "source_uri": { - "name": "source_uri", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_license": { - "name": "source_license", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_conditions_obs_geom": { - "name": "idx_conditions_obs_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_conditions_obs_domain": { - "name": "idx_conditions_obs_domain", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_dom_type": { - "name": "idx_conditions_obs_dom_type", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_severity": { - "name": "idx_conditions_obs_severity", - "columns": [ - { - "expression": "severity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_metric": { - "name": "idx_conditions_obs_metric", - "columns": [ - { - "expression": "metric", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_valid_to": { - "name": "idx_conditions_obs_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_expires": { - "name": "idx_conditions_obs_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_subject": { - "name": "idx_conditions_obs_subject", - "columns": [ - { - "expression": "subject", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_source": { - "name": "idx_conditions_obs_source", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_canonical": { - "name": "idx_conditions_obs_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_content_hash": { - "name": "idx_conditions_obs_content_hash", - "columns": [ - { - "expression": "content_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_phenomenon": { - "name": "idx_conditions_obs_phenomenon", - "columns": [ - { - "expression": "phenomenon_fingerprint", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_instance": { - "name": "idx_conditions_obs_instance", - "columns": [ - { - "expression": "instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_privacy": { - "name": "idx_conditions_obs_privacy", - "columns": [ - { - "expression": "privacy_class", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_evidence_state": { - "name": "idx_conditions_obs_evidence_state", - "columns": [ - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_flagged": { - "name": "idx_conditions_obs_flagged", - "columns": [ - { - "expression": "flagged_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observations\".\"flagged_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_corroborations": { - "name": "idx_conditions_obs_corroborations", - "columns": [ - { - "expression": "corroborations", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_replaces": { - "name": "idx_conditions_obs_replaces", - "columns": [ - { - "expression": "replaces", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "obs_confidence_score_range": { - "name": "obs_confidence_score_range", - "value": "\"conditions\".\"observations\".\"confidence_score\" IS NULL OR (\"conditions\".\"observations\".\"confidence_score\" >= 0 AND \"conditions\".\"observations\".\"confidence_score\" <= 1)" - }, - "obs_dp_epsilon_nonneg": { - "name": "obs_dp_epsilon_nonneg", - "value": "\"conditions\".\"observations\".\"dp_epsilon\" IS NULL OR \"conditions\".\"observations\".\"dp_epsilon\" >= 0" - }, - "obs_dp_delta_range": { - "name": "obs_dp_delta_range", - "value": "\"conditions\".\"observations\".\"dp_delta\" IS NULL OR (\"conditions\".\"observations\".\"dp_delta\" >= 0 AND \"conditions\".\"observations\".\"dp_delta\" < 1)" - }, - "obs_k_anonymity_positive": { - "name": "obs_k_anonymity_positive", - "value": "\"conditions\".\"observations\".\"k_anonymity\" IS NULL OR \"conditions\".\"observations\".\"k_anonymity\" > 0" - }, - "obs_severity_level_range": { - "name": "obs_severity_level_range", - "value": "\"conditions\".\"observations\".\"severity_level\" IS NULL OR (\"conditions\".\"observations\".\"severity_level\" >= 1 AND \"conditions\".\"observations\".\"severity_level\" <= 5)" - }, - "obs_fuzziness_enum": { - "name": "obs_fuzziness_enum", - "value": "\"fuzziness\" IN ('exact', 'low_res', 'medium_res', 'end_unknown', 'start_unknown', 'extent_unknown')" - }, - "obs_privacy_class_enum": { - "name": "obs_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym', 'unknown')" - }, - "obs_evidence_state_enum": { - "name": "obs_evidence_state_enum", - "value": "\"conditions\".\"observations\".\"evidence_state\" IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - }, - "obs_tombstone_reason_enum": { - "name": "obs_tombstone_reason_enum", - "value": "\"conditions\".\"observations\".\"tombstone_reason\" IS NULL OR \"conditions\".\"observations\".\"tombstone_reason\" IN ('deleted_by_source','gdpr_erasure','retracted_as_wrong','expired','legal_takedown')" - } - }, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_observation": { - "name": "idx_report_evidence_observation", - "columns": [ - { - "expression": "observation_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"conditions\".\"report_evidence\".\"evidence_kind\" IN ('report','confirm','negate','official_match','reviewer_accept','reviewer_reject','expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "sensor_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_hourly": { - "name": "sensor_speed_hourly", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "speed_bins": { - "name": "speed_bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": true - }, - "speed_counts": { - "name": "speed_counts", - "type": "integer[]", - "primaryKey": false, - "notNull": true - }, - "finalized": { - "name": "finalized", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "idx_sensor_hourly_hour": { - "name": "idx_sensor_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_speed_hourly_sensor_key_hour_utc_pk": { - "name": "sensor_speed_hourly_sensor_key_hour_utc_pk", - "columns": [ - "sensor_key", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_sample": { - "name": "sensor_speed_sample", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_sample_key_bucket": { - "name": "idx_sensor_sample_key_bucket", - "columns": [ - { - "expression": "sensor_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_hour", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sensor_sample_observed": { - "name": "idx_sensor_sample_observed", - "columns": [ - { - "expression": "observed_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_sensor_sample_key_observed": { - "name": "uq_sensor_sample_key_observed", - "nullsNotDistinct": false, - "columns": [ - "sensor_key", - "observed_at" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.speed_rollup_progress": { - "name": "speed_rollup_progress", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "default": 1 - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "speed_rollup_progress_singleton": { - "name": "speed_rollup_progress_singleton", - "value": "\"conditions\".\"speed_rollup_progress\".\"id\" = 1" - } - }, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_subject": { - "name": "idx_sub_claim_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"conditions\".\"sub_claim\".\"claim_type\" IN ('confirm','negate','flag')" - } - }, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "produces": { - "name": "produces", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - }, - "source_produces_enum": { - "name": "source_produces_enum", - "value": "\"conditions\".\"source\".\"produces\" IN ('events', 'flow')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0041_snapshot.json b/packages/core/drizzle/meta/0041_snapshot.json deleted file mode 100644 index 174b6e480..000000000 --- a/packages/core/drizzle/meta/0041_snapshot.json +++ /dev/null @@ -1,5893 +0,0 @@ -{ - "id": "4cd397fb-09e9-4903-bf75-be7d07f5bcc0", - "prevId": "c31f4778-84b5-4117-87db-90207b210220", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_observation_latest_property": { - "name": "idx_observation_latest_property", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "nullsNotDistinct": false, - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ] - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "tableTo": "offer", - "schemaTo": "conditions", - "columnsFrom": [ - "offer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "observation_revision": { - "name": "observation_revision", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "binding_queue_observation_id_observations_id_fk": { - "name": "binding_queue_observation_id_observations_id_fk", - "tableFrom": "binding_queue", - "tableTo": "observations", - "schemaTo": "conditions", - "columnsFrom": [ - "observation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "object_id": { - "name": "object_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_snapshot": { - "name": "payload_snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_object": { - "name": "idx_federation_outbox_object", - "columns": [ - { - "expression": "object_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_binding": { - "name": "observation_binding", - "schema": "conditions", - "columns": { - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'single'" - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observation_revision": { - "name": "observation_revision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_binding_status": { - "name": "idx_observation_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_binding_observation_id_observations_id_fk": { - "name": "observation_binding_observation_id_observations_id_fk", - "tableFrom": "observation_binding", - "tableTo": "observations", - "schemaTo": "conditions", - "columnsFrom": [ - "observation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_segment": { - "name": "observation_segment", - "schema": "conditions", - "columns": { - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_segment_segment": { - "name": "idx_observation_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_segment_observation_id_observations_id_fk": { - "name": "observation_segment_observation_id_observations_id_fk", - "tableFrom": "observation_segment", - "tableTo": "observations", - "schemaTo": "conditions", - "columnsFrom": [ - "observation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_segment_observation_id_seq_pk": { - "name": "observation_segment_observation_id_seq_pk", - "columns": [ - "observation_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observations": { - "name": "observations", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_format": { - "name": "source_format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity_source": { - "name": "severity_source", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "headline": { - "name": "headline", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "metric": { - "name": "metric", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "level": { - "name": "level", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "aggregation": { - "name": "aggregation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "subject": { - "name": "subject", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "attributes": { - "name": "attributes", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "schedule": { - "name": "schedule", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_forecast": { - "name": "is_forecast", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "related_ids": { - "name": "related_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "origin": { - "name": "origin", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "data_updated_at": { - "name": "data_updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "is_stale": { - "name": "is_stale", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "stale_after": { - "name": "stale_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "phenomenon_fingerprint": { - "name": "phenomenon_fingerprint", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "replaces": { - "name": "replaces", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "fuzziness": { - "name": "fuzziness", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'exact'" - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'unknown'" - }, - "k_anonymity": { - "name": "k_anonymity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "dp_epsilon": { - "name": "dp_epsilon", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "dp_delta": { - "name": "dp_delta", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "informed": { - "name": "informed", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "source_uri": { - "name": "source_uri", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_license": { - "name": "source_license", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_conditions_obs_geom": { - "name": "idx_conditions_obs_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_conditions_obs_domain": { - "name": "idx_conditions_obs_domain", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_dom_type": { - "name": "idx_conditions_obs_dom_type", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_severity": { - "name": "idx_conditions_obs_severity", - "columns": [ - { - "expression": "severity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_metric": { - "name": "idx_conditions_obs_metric", - "columns": [ - { - "expression": "metric", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_valid_to": { - "name": "idx_conditions_obs_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_expires": { - "name": "idx_conditions_obs_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_subject": { - "name": "idx_conditions_obs_subject", - "columns": [ - { - "expression": "subject", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_source": { - "name": "idx_conditions_obs_source", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_canonical": { - "name": "idx_conditions_obs_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_content_hash": { - "name": "idx_conditions_obs_content_hash", - "columns": [ - { - "expression": "content_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_phenomenon": { - "name": "idx_conditions_obs_phenomenon", - "columns": [ - { - "expression": "phenomenon_fingerprint", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_instance": { - "name": "idx_conditions_obs_instance", - "columns": [ - { - "expression": "instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_privacy": { - "name": "idx_conditions_obs_privacy", - "columns": [ - { - "expression": "privacy_class", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_evidence_state": { - "name": "idx_conditions_obs_evidence_state", - "columns": [ - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_flagged": { - "name": "idx_conditions_obs_flagged", - "columns": [ - { - "expression": "flagged_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observations\".\"flagged_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_corroborations": { - "name": "idx_conditions_obs_corroborations", - "columns": [ - { - "expression": "corroborations", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_replaces": { - "name": "idx_conditions_obs_replaces", - "columns": [ - { - "expression": "replaces", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "obs_confidence_score_range": { - "name": "obs_confidence_score_range", - "value": "\"conditions\".\"observations\".\"confidence_score\" IS NULL OR (\"conditions\".\"observations\".\"confidence_score\" >= 0 AND \"conditions\".\"observations\".\"confidence_score\" <= 1)" - }, - "obs_dp_epsilon_nonneg": { - "name": "obs_dp_epsilon_nonneg", - "value": "\"conditions\".\"observations\".\"dp_epsilon\" IS NULL OR \"conditions\".\"observations\".\"dp_epsilon\" >= 0" - }, - "obs_dp_delta_range": { - "name": "obs_dp_delta_range", - "value": "\"conditions\".\"observations\".\"dp_delta\" IS NULL OR (\"conditions\".\"observations\".\"dp_delta\" >= 0 AND \"conditions\".\"observations\".\"dp_delta\" < 1)" - }, - "obs_k_anonymity_positive": { - "name": "obs_k_anonymity_positive", - "value": "\"conditions\".\"observations\".\"k_anonymity\" IS NULL OR \"conditions\".\"observations\".\"k_anonymity\" > 0" - }, - "obs_severity_level_range": { - "name": "obs_severity_level_range", - "value": "\"conditions\".\"observations\".\"severity_level\" IS NULL OR (\"conditions\".\"observations\".\"severity_level\" >= 1 AND \"conditions\".\"observations\".\"severity_level\" <= 5)" - }, - "obs_fuzziness_enum": { - "name": "obs_fuzziness_enum", - "value": "\"fuzziness\" IN ('exact', 'low_res', 'medium_res', 'end_unknown', 'start_unknown', 'extent_unknown')" - }, - "obs_privacy_class_enum": { - "name": "obs_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym', 'unknown')" - }, - "obs_evidence_state_enum": { - "name": "obs_evidence_state_enum", - "value": "\"conditions\".\"observations\".\"evidence_state\" IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - }, - "obs_tombstone_reason_enum": { - "name": "obs_tombstone_reason_enum", - "value": "\"conditions\".\"observations\".\"tombstone_reason\" IS NULL OR \"conditions\".\"observations\".\"tombstone_reason\" IN ('deleted_by_source','gdpr_erasure','retracted_as_wrong','expired','legal_takedown')" - } - }, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_observation": { - "name": "idx_report_evidence_observation", - "columns": [ - { - "expression": "observation_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"conditions\".\"report_evidence\".\"evidence_kind\" IN ('report','confirm','negate','official_match','reviewer_accept','reviewer_reject','expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "sensor_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_hourly": { - "name": "sensor_speed_hourly", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "speed_bins": { - "name": "speed_bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": true - }, - "speed_counts": { - "name": "speed_counts", - "type": "integer[]", - "primaryKey": false, - "notNull": true - }, - "finalized": { - "name": "finalized", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "idx_sensor_hourly_hour": { - "name": "idx_sensor_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_speed_hourly_sensor_key_hour_utc_pk": { - "name": "sensor_speed_hourly_sensor_key_hour_utc_pk", - "columns": [ - "sensor_key", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_sample": { - "name": "sensor_speed_sample", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_sample_key_bucket": { - "name": "idx_sensor_sample_key_bucket", - "columns": [ - { - "expression": "sensor_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_hour", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sensor_sample_observed": { - "name": "idx_sensor_sample_observed", - "columns": [ - { - "expression": "observed_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_sensor_sample_key_observed": { - "name": "uq_sensor_sample_key_observed", - "nullsNotDistinct": false, - "columns": [ - "sensor_key", - "observed_at" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.speed_rollup_progress": { - "name": "speed_rollup_progress", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "default": 1 - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "speed_rollup_progress_singleton": { - "name": "speed_rollup_progress_singleton", - "value": "\"conditions\".\"speed_rollup_progress\".\"id\" = 1" - } - }, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_subject": { - "name": "idx_sub_claim_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"conditions\".\"sub_claim\".\"claim_type\" IN ('confirm','negate','flag')" - } - }, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "produces": { - "name": "produces", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - }, - "source_produces_enum": { - "name": "source_produces_enum", - "value": "\"conditions\".\"source\".\"produces\" IN ('events', 'flow')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0042_snapshot.json b/packages/core/drizzle/meta/0042_snapshot.json deleted file mode 100644 index 6cf06a584..000000000 --- a/packages/core/drizzle/meta/0042_snapshot.json +++ /dev/null @@ -1,6116 +0,0 @@ -{ - "id": "c8394f39-0322-458c-a4a3-e3a4a037cead", - "prevId": "4cd397fb-09e9-4903-bf75-be7d07f5bcc0", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_observation_latest_property": { - "name": "idx_observation_latest_property", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "nullsNotDistinct": false, - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ] - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "tableTo": "offer", - "schemaTo": "conditions", - "columnsFrom": [ - "offer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "observation_revision": { - "name": "observation_revision", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "binding_queue_observation_id_observations_id_fk": { - "name": "binding_queue_observation_id_observations_id_fk", - "tableFrom": "binding_queue", - "tableTo": "observations", - "schemaTo": "conditions", - "columnsFrom": [ - "observation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "object_id": { - "name": "object_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_snapshot": { - "name": "payload_snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_object": { - "name": "idx_federation_outbox_object", - "columns": [ - { - "expression": "object_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_binding": { - "name": "observation_binding", - "schema": "conditions", - "columns": { - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'single'" - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observation_revision": { - "name": "observation_revision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_binding_status": { - "name": "idx_observation_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_binding_observation_id_observations_id_fk": { - "name": "observation_binding_observation_id_observations_id_fk", - "tableFrom": "observation_binding", - "tableTo": "observations", - "schemaTo": "conditions", - "columnsFrom": [ - "observation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_segment": { - "name": "observation_segment", - "schema": "conditions", - "columns": { - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_segment_segment": { - "name": "idx_observation_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_segment_observation_id_observations_id_fk": { - "name": "observation_segment_observation_id_observations_id_fk", - "tableFrom": "observation_segment", - "tableTo": "observations", - "schemaTo": "conditions", - "columnsFrom": [ - "observation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_segment_observation_id_seq_pk": { - "name": "observation_segment_observation_id_seq_pk", - "columns": [ - "observation_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observations": { - "name": "observations", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_format": { - "name": "source_format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity_source": { - "name": "severity_source", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "headline": { - "name": "headline", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "metric": { - "name": "metric", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "level": { - "name": "level", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "aggregation": { - "name": "aggregation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "subject": { - "name": "subject", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "attributes": { - "name": "attributes", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "schedule": { - "name": "schedule", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_forecast": { - "name": "is_forecast", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "related_ids": { - "name": "related_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "origin": { - "name": "origin", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "data_updated_at": { - "name": "data_updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "is_stale": { - "name": "is_stale", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "stale_after": { - "name": "stale_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "phenomenon_fingerprint": { - "name": "phenomenon_fingerprint", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "replaces": { - "name": "replaces", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "fuzziness": { - "name": "fuzziness", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'exact'" - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'unknown'" - }, - "k_anonymity": { - "name": "k_anonymity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "dp_epsilon": { - "name": "dp_epsilon", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "dp_delta": { - "name": "dp_delta", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "informed": { - "name": "informed", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "source_uri": { - "name": "source_uri", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_license": { - "name": "source_license", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_conditions_obs_geom": { - "name": "idx_conditions_obs_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_conditions_obs_domain": { - "name": "idx_conditions_obs_domain", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_dom_type": { - "name": "idx_conditions_obs_dom_type", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_severity": { - "name": "idx_conditions_obs_severity", - "columns": [ - { - "expression": "severity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_metric": { - "name": "idx_conditions_obs_metric", - "columns": [ - { - "expression": "metric", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_valid_to": { - "name": "idx_conditions_obs_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_expires": { - "name": "idx_conditions_obs_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_subject": { - "name": "idx_conditions_obs_subject", - "columns": [ - { - "expression": "subject", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_source": { - "name": "idx_conditions_obs_source", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_canonical": { - "name": "idx_conditions_obs_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_content_hash": { - "name": "idx_conditions_obs_content_hash", - "columns": [ - { - "expression": "content_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_phenomenon": { - "name": "idx_conditions_obs_phenomenon", - "columns": [ - { - "expression": "phenomenon_fingerprint", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_instance": { - "name": "idx_conditions_obs_instance", - "columns": [ - { - "expression": "instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_privacy": { - "name": "idx_conditions_obs_privacy", - "columns": [ - { - "expression": "privacy_class", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_evidence_state": { - "name": "idx_conditions_obs_evidence_state", - "columns": [ - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_flagged": { - "name": "idx_conditions_obs_flagged", - "columns": [ - { - "expression": "flagged_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observations\".\"flagged_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_corroborations": { - "name": "idx_conditions_obs_corroborations", - "columns": [ - { - "expression": "corroborations", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_replaces": { - "name": "idx_conditions_obs_replaces", - "columns": [ - { - "expression": "replaces", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "obs_confidence_score_range": { - "name": "obs_confidence_score_range", - "value": "\"conditions\".\"observations\".\"confidence_score\" IS NULL OR (\"conditions\".\"observations\".\"confidence_score\" >= 0 AND \"conditions\".\"observations\".\"confidence_score\" <= 1)" - }, - "obs_dp_epsilon_nonneg": { - "name": "obs_dp_epsilon_nonneg", - "value": "\"conditions\".\"observations\".\"dp_epsilon\" IS NULL OR \"conditions\".\"observations\".\"dp_epsilon\" >= 0" - }, - "obs_dp_delta_range": { - "name": "obs_dp_delta_range", - "value": "\"conditions\".\"observations\".\"dp_delta\" IS NULL OR (\"conditions\".\"observations\".\"dp_delta\" >= 0 AND \"conditions\".\"observations\".\"dp_delta\" < 1)" - }, - "obs_k_anonymity_positive": { - "name": "obs_k_anonymity_positive", - "value": "\"conditions\".\"observations\".\"k_anonymity\" IS NULL OR \"conditions\".\"observations\".\"k_anonymity\" > 0" - }, - "obs_severity_level_range": { - "name": "obs_severity_level_range", - "value": "\"conditions\".\"observations\".\"severity_level\" IS NULL OR (\"conditions\".\"observations\".\"severity_level\" >= 1 AND \"conditions\".\"observations\".\"severity_level\" <= 5)" - }, - "obs_fuzziness_enum": { - "name": "obs_fuzziness_enum", - "value": "\"fuzziness\" IN ('exact', 'low_res', 'medium_res', 'end_unknown', 'start_unknown', 'extent_unknown')" - }, - "obs_privacy_class_enum": { - "name": "obs_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym', 'unknown')" - }, - "obs_evidence_state_enum": { - "name": "obs_evidence_state_enum", - "value": "\"conditions\".\"observations\".\"evidence_state\" IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - }, - "obs_tombstone_reason_enum": { - "name": "obs_tombstone_reason_enum", - "value": "\"conditions\".\"observations\".\"tombstone_reason\" IS NULL OR \"conditions\".\"observations\".\"tombstone_reason\" IN ('deleted_by_source','gdpr_erasure','retracted_as_wrong','expired','legal_takedown')" - } - }, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_observation": { - "name": "idx_report_evidence_observation", - "columns": [ - { - "expression": "observation_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"conditions\".\"report_evidence\".\"evidence_kind\" IN ('report','confirm','negate','official_match','reviewer_accept','reviewer_reject','expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "sensor_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_hourly": { - "name": "sensor_speed_hourly", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "speed_bins": { - "name": "speed_bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": true - }, - "speed_counts": { - "name": "speed_counts", - "type": "integer[]", - "primaryKey": false, - "notNull": true - }, - "finalized": { - "name": "finalized", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "idx_sensor_hourly_hour": { - "name": "idx_sensor_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_speed_hourly_sensor_key_hour_utc_pk": { - "name": "sensor_speed_hourly_sensor_key_hour_utc_pk", - "columns": [ - "sensor_key", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_sample": { - "name": "sensor_speed_sample", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_sample_key_bucket": { - "name": "idx_sensor_sample_key_bucket", - "columns": [ - { - "expression": "sensor_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_hour", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sensor_sample_observed": { - "name": "idx_sensor_sample_observed", - "columns": [ - { - "expression": "observed_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_sensor_sample_key_observed": { - "name": "uq_sensor_sample_key_observed", - "nullsNotDistinct": false, - "columns": [ - "sensor_key", - "observed_at" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.speed_rollup_progress": { - "name": "speed_rollup_progress", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "default": 1 - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "speed_rollup_progress_singleton": { - "name": "speed_rollup_progress_singleton", - "value": "\"conditions\".\"speed_rollup_progress\".\"id\" = 1" - } - }, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_subject": { - "name": "idx_sub_claim_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"conditions\".\"sub_claim\".\"claim_type\" IN ('confirm','negate','flag')" - } - }, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "produces": { - "name": "produces", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - }, - "source_produces_enum": { - "name": "source_produces_enum", - "value": "\"conditions\".\"source\".\"produces\" IN ('events', 'flow')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0043_snapshot.json b/packages/core/drizzle/meta/0043_snapshot.json deleted file mode 100644 index 215f08ade..000000000 --- a/packages/core/drizzle/meta/0043_snapshot.json +++ /dev/null @@ -1,5821 +0,0 @@ -{ - "id": "380d74ab-3fda-4ecf-873a-7a823a142954", - "prevId": "c8394f39-0322-458c-a4a3-e3a4a037cead", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_observation_latest_property": { - "name": "idx_observation_latest_property", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "nullsNotDistinct": false, - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ] - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "tableTo": "offer", - "schemaTo": "conditions", - "columnsFrom": [ - "offer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "object_id": { - "name": "object_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_snapshot": { - "name": "payload_snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_object": { - "name": "idx_federation_outbox_object", - "columns": [ - { - "expression": "object_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observations": { - "name": "observations", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_format": { - "name": "source_format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity_source": { - "name": "severity_source", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "headline": { - "name": "headline", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "metric": { - "name": "metric", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "level": { - "name": "level", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "aggregation": { - "name": "aggregation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "subject": { - "name": "subject", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "attributes": { - "name": "attributes", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "schedule": { - "name": "schedule", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_forecast": { - "name": "is_forecast", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "related_ids": { - "name": "related_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "origin": { - "name": "origin", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "data_updated_at": { - "name": "data_updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "is_stale": { - "name": "is_stale", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "stale_after": { - "name": "stale_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "phenomenon_fingerprint": { - "name": "phenomenon_fingerprint", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "replaces": { - "name": "replaces", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "fuzziness": { - "name": "fuzziness", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'exact'" - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'unknown'" - }, - "k_anonymity": { - "name": "k_anonymity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "dp_epsilon": { - "name": "dp_epsilon", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "dp_delta": { - "name": "dp_delta", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "informed": { - "name": "informed", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "source_uri": { - "name": "source_uri", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_license": { - "name": "source_license", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_conditions_obs_geom": { - "name": "idx_conditions_obs_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_conditions_obs_domain": { - "name": "idx_conditions_obs_domain", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_dom_type": { - "name": "idx_conditions_obs_dom_type", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_severity": { - "name": "idx_conditions_obs_severity", - "columns": [ - { - "expression": "severity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_metric": { - "name": "idx_conditions_obs_metric", - "columns": [ - { - "expression": "metric", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_valid_to": { - "name": "idx_conditions_obs_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_expires": { - "name": "idx_conditions_obs_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_subject": { - "name": "idx_conditions_obs_subject", - "columns": [ - { - "expression": "subject", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_source": { - "name": "idx_conditions_obs_source", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_canonical": { - "name": "idx_conditions_obs_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_content_hash": { - "name": "idx_conditions_obs_content_hash", - "columns": [ - { - "expression": "content_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_phenomenon": { - "name": "idx_conditions_obs_phenomenon", - "columns": [ - { - "expression": "phenomenon_fingerprint", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_instance": { - "name": "idx_conditions_obs_instance", - "columns": [ - { - "expression": "instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_privacy": { - "name": "idx_conditions_obs_privacy", - "columns": [ - { - "expression": "privacy_class", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_evidence_state": { - "name": "idx_conditions_obs_evidence_state", - "columns": [ - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_flagged": { - "name": "idx_conditions_obs_flagged", - "columns": [ - { - "expression": "flagged_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observations\".\"flagged_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_corroborations": { - "name": "idx_conditions_obs_corroborations", - "columns": [ - { - "expression": "corroborations", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_replaces": { - "name": "idx_conditions_obs_replaces", - "columns": [ - { - "expression": "replaces", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "obs_confidence_score_range": { - "name": "obs_confidence_score_range", - "value": "\"conditions\".\"observations\".\"confidence_score\" IS NULL OR (\"conditions\".\"observations\".\"confidence_score\" >= 0 AND \"conditions\".\"observations\".\"confidence_score\" <= 1)" - }, - "obs_dp_epsilon_nonneg": { - "name": "obs_dp_epsilon_nonneg", - "value": "\"conditions\".\"observations\".\"dp_epsilon\" IS NULL OR \"conditions\".\"observations\".\"dp_epsilon\" >= 0" - }, - "obs_dp_delta_range": { - "name": "obs_dp_delta_range", - "value": "\"conditions\".\"observations\".\"dp_delta\" IS NULL OR (\"conditions\".\"observations\".\"dp_delta\" >= 0 AND \"conditions\".\"observations\".\"dp_delta\" < 1)" - }, - "obs_k_anonymity_positive": { - "name": "obs_k_anonymity_positive", - "value": "\"conditions\".\"observations\".\"k_anonymity\" IS NULL OR \"conditions\".\"observations\".\"k_anonymity\" > 0" - }, - "obs_severity_level_range": { - "name": "obs_severity_level_range", - "value": "\"conditions\".\"observations\".\"severity_level\" IS NULL OR (\"conditions\".\"observations\".\"severity_level\" >= 1 AND \"conditions\".\"observations\".\"severity_level\" <= 5)" - }, - "obs_fuzziness_enum": { - "name": "obs_fuzziness_enum", - "value": "\"fuzziness\" IN ('exact', 'low_res', 'medium_res', 'end_unknown', 'start_unknown', 'extent_unknown')" - }, - "obs_privacy_class_enum": { - "name": "obs_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym', 'unknown')" - }, - "obs_evidence_state_enum": { - "name": "obs_evidence_state_enum", - "value": "\"conditions\".\"observations\".\"evidence_state\" IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - }, - "obs_tombstone_reason_enum": { - "name": "obs_tombstone_reason_enum", - "value": "\"conditions\".\"observations\".\"tombstone_reason\" IS NULL OR \"conditions\".\"observations\".\"tombstone_reason\" IN ('deleted_by_source','gdpr_erasure','retracted_as_wrong','expired','legal_takedown')" - } - }, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_observation": { - "name": "idx_report_evidence_observation", - "columns": [ - { - "expression": "observation_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"conditions\".\"report_evidence\".\"evidence_kind\" IN ('report','confirm','negate','official_match','reviewer_accept','reviewer_reject','expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "sensor_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_hourly": { - "name": "sensor_speed_hourly", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "speed_bins": { - "name": "speed_bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": true - }, - "speed_counts": { - "name": "speed_counts", - "type": "integer[]", - "primaryKey": false, - "notNull": true - }, - "finalized": { - "name": "finalized", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "idx_sensor_hourly_hour": { - "name": "idx_sensor_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_speed_hourly_sensor_key_hour_utc_pk": { - "name": "sensor_speed_hourly_sensor_key_hour_utc_pk", - "columns": [ - "sensor_key", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_sample": { - "name": "sensor_speed_sample", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_sample_key_bucket": { - "name": "idx_sensor_sample_key_bucket", - "columns": [ - { - "expression": "sensor_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_hour", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sensor_sample_observed": { - "name": "idx_sensor_sample_observed", - "columns": [ - { - "expression": "observed_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_sensor_sample_key_observed": { - "name": "uq_sensor_sample_key_observed", - "nullsNotDistinct": false, - "columns": [ - "sensor_key", - "observed_at" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.speed_rollup_progress": { - "name": "speed_rollup_progress", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "default": 1 - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "speed_rollup_progress_singleton": { - "name": "speed_rollup_progress_singleton", - "value": "\"conditions\".\"speed_rollup_progress\".\"id\" = 1" - } - }, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_subject": { - "name": "idx_sub_claim_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"conditions\".\"sub_claim\".\"claim_type\" IN ('confirm','negate','flag')" - } - }, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "produces": { - "name": "produces", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - }, - "source_produces_enum": { - "name": "source_produces_enum", - "value": "\"conditions\".\"source\".\"produces\" IN ('events', 'flow')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0044_snapshot.json b/packages/core/drizzle/meta/0044_snapshot.json deleted file mode 100644 index 977f63b77..000000000 --- a/packages/core/drizzle/meta/0044_snapshot.json +++ /dev/null @@ -1,5911 +0,0 @@ -{ - "id": "01838db4-634f-4e0f-a276-5712afc9b963", - "prevId": "380d74ab-3fda-4ecf-873a-7a823a142954", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_observation_latest_property": { - "name": "idx_observation_latest_property", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "nullsNotDistinct": false, - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ] - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "tableTo": "offer", - "schemaTo": "conditions", - "columnsFrom": [ - "offer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "object_id": { - "name": "object_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_snapshot": { - "name": "payload_snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_object": { - "name": "idx_federation_outbox_object", - "columns": [ - { - "expression": "object_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observations": { - "name": "observations", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_format": { - "name": "source_format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity_source": { - "name": "severity_source", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "headline": { - "name": "headline", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "metric": { - "name": "metric", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "level": { - "name": "level", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "aggregation": { - "name": "aggregation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "subject": { - "name": "subject", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "attributes": { - "name": "attributes", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "schedule": { - "name": "schedule", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_forecast": { - "name": "is_forecast", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "related_ids": { - "name": "related_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "origin": { - "name": "origin", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "data_updated_at": { - "name": "data_updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "is_stale": { - "name": "is_stale", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "stale_after": { - "name": "stale_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "phenomenon_fingerprint": { - "name": "phenomenon_fingerprint", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "replaces": { - "name": "replaces", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "fuzziness": { - "name": "fuzziness", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'exact'" - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'unknown'" - }, - "k_anonymity": { - "name": "k_anonymity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "dp_epsilon": { - "name": "dp_epsilon", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "dp_delta": { - "name": "dp_delta", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "informed": { - "name": "informed", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "source_uri": { - "name": "source_uri", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_license": { - "name": "source_license", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_conditions_obs_geom": { - "name": "idx_conditions_obs_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_conditions_obs_domain": { - "name": "idx_conditions_obs_domain", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_dom_type": { - "name": "idx_conditions_obs_dom_type", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_severity": { - "name": "idx_conditions_obs_severity", - "columns": [ - { - "expression": "severity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_metric": { - "name": "idx_conditions_obs_metric", - "columns": [ - { - "expression": "metric", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_valid_to": { - "name": "idx_conditions_obs_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_expires": { - "name": "idx_conditions_obs_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_subject": { - "name": "idx_conditions_obs_subject", - "columns": [ - { - "expression": "subject", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_source": { - "name": "idx_conditions_obs_source", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_canonical": { - "name": "idx_conditions_obs_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_content_hash": { - "name": "idx_conditions_obs_content_hash", - "columns": [ - { - "expression": "content_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_phenomenon": { - "name": "idx_conditions_obs_phenomenon", - "columns": [ - { - "expression": "phenomenon_fingerprint", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_instance": { - "name": "idx_conditions_obs_instance", - "columns": [ - { - "expression": "instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_privacy": { - "name": "idx_conditions_obs_privacy", - "columns": [ - { - "expression": "privacy_class", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_evidence_state": { - "name": "idx_conditions_obs_evidence_state", - "columns": [ - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_flagged": { - "name": "idx_conditions_obs_flagged", - "columns": [ - { - "expression": "flagged_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observations\".\"flagged_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_corroborations": { - "name": "idx_conditions_obs_corroborations", - "columns": [ - { - "expression": "corroborations", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_replaces": { - "name": "idx_conditions_obs_replaces", - "columns": [ - { - "expression": "replaces", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "obs_confidence_score_range": { - "name": "obs_confidence_score_range", - "value": "\"conditions\".\"observations\".\"confidence_score\" IS NULL OR (\"conditions\".\"observations\".\"confidence_score\" >= 0 AND \"conditions\".\"observations\".\"confidence_score\" <= 1)" - }, - "obs_dp_epsilon_nonneg": { - "name": "obs_dp_epsilon_nonneg", - "value": "\"conditions\".\"observations\".\"dp_epsilon\" IS NULL OR \"conditions\".\"observations\".\"dp_epsilon\" >= 0" - }, - "obs_dp_delta_range": { - "name": "obs_dp_delta_range", - "value": "\"conditions\".\"observations\".\"dp_delta\" IS NULL OR (\"conditions\".\"observations\".\"dp_delta\" >= 0 AND \"conditions\".\"observations\".\"dp_delta\" < 1)" - }, - "obs_k_anonymity_positive": { - "name": "obs_k_anonymity_positive", - "value": "\"conditions\".\"observations\".\"k_anonymity\" IS NULL OR \"conditions\".\"observations\".\"k_anonymity\" > 0" - }, - "obs_severity_level_range": { - "name": "obs_severity_level_range", - "value": "\"conditions\".\"observations\".\"severity_level\" IS NULL OR (\"conditions\".\"observations\".\"severity_level\" >= 1 AND \"conditions\".\"observations\".\"severity_level\" <= 5)" - }, - "obs_fuzziness_enum": { - "name": "obs_fuzziness_enum", - "value": "\"fuzziness\" IN ('exact', 'low_res', 'medium_res', 'end_unknown', 'start_unknown', 'extent_unknown')" - }, - "obs_privacy_class_enum": { - "name": "obs_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym', 'unknown')" - }, - "obs_evidence_state_enum": { - "name": "obs_evidence_state_enum", - "value": "\"conditions\".\"observations\".\"evidence_state\" IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - }, - "obs_tombstone_reason_enum": { - "name": "obs_tombstone_reason_enum", - "value": "\"conditions\".\"observations\".\"tombstone_reason\" IS NULL OR \"conditions\".\"observations\".\"tombstone_reason\" IN ('deleted_by_source','gdpr_erasure','retracted_as_wrong','expired','legal_takedown')" - } - }, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "observation_id": { - "name": "observation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_observation": { - "name": "idx_report_evidence_observation", - "columns": [ - { - "expression": "observation_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"conditions\".\"report_evidence\".\"evidence_kind\" IN ('report','confirm','negate','official_match','reviewer_accept','reviewer_reject','expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "sensor_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_hourly": { - "name": "sensor_speed_hourly", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "speed_bins": { - "name": "speed_bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": true - }, - "speed_counts": { - "name": "speed_counts", - "type": "integer[]", - "primaryKey": false, - "notNull": true - }, - "finalized": { - "name": "finalized", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "idx_sensor_hourly_hour": { - "name": "idx_sensor_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_speed_hourly_sensor_key_hour_utc_pk": { - "name": "sensor_speed_hourly_sensor_key_hour_utc_pk", - "columns": [ - "sensor_key", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_sample": { - "name": "sensor_speed_sample", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_sample_key_bucket": { - "name": "idx_sensor_sample_key_bucket", - "columns": [ - { - "expression": "sensor_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_hour", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sensor_sample_observed": { - "name": "idx_sensor_sample_observed", - "columns": [ - { - "expression": "observed_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_sensor_sample_key_observed": { - "name": "uq_sensor_sample_key_observed", - "nullsNotDistinct": false, - "columns": [ - "sensor_key", - "observed_at" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.speed_rollup_progress": { - "name": "speed_rollup_progress", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "default": 1 - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "speed_rollup_progress_singleton": { - "name": "speed_rollup_progress_singleton", - "value": "\"conditions\".\"speed_rollup_progress\".\"id\" = 1" - } - }, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_subject": { - "name": "idx_sub_claim_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"conditions\".\"sub_claim\".\"claim_type\" IN ('confirm','negate','flag')" - } - }, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "produces": { - "name": "produces", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - }, - "source_produces_enum": { - "name": "source_produces_enum", - "value": "\"conditions\".\"source\".\"produces\" IN ('events', 'flow')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0045_snapshot.json b/packages/core/drizzle/meta/0045_snapshot.json deleted file mode 100644 index 54a819d86..000000000 --- a/packages/core/drizzle/meta/0045_snapshot.json +++ /dev/null @@ -1,5995 +0,0 @@ -{ - "id": "56fc081c-b1d8-4674-be2d-d40ef70d9770", - "prevId": "01838db4-634f-4e0f-a276-5712afc9b963", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_observation_latest_property": { - "name": "idx_observation_latest_property", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "nullsNotDistinct": false, - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ] - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "tableTo": "offer", - "schemaTo": "conditions", - "columnsFrom": [ - "offer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "object_id": { - "name": "object_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_snapshot": { - "name": "payload_snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_object": { - "name": "idx_federation_outbox_object", - "columns": [ - { - "expression": "object_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observations": { - "name": "observations", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_format": { - "name": "source_format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity_source": { - "name": "severity_source", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "headline": { - "name": "headline", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "metric": { - "name": "metric", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "level": { - "name": "level", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "aggregation": { - "name": "aggregation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "subject": { - "name": "subject", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "attributes": { - "name": "attributes", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "schedule": { - "name": "schedule", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_forecast": { - "name": "is_forecast", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "related_ids": { - "name": "related_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "origin": { - "name": "origin", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "data_updated_at": { - "name": "data_updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "is_stale": { - "name": "is_stale", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "stale_after": { - "name": "stale_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "phenomenon_fingerprint": { - "name": "phenomenon_fingerprint", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "replaces": { - "name": "replaces", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "fuzziness": { - "name": "fuzziness", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'exact'" - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'unknown'" - }, - "k_anonymity": { - "name": "k_anonymity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "dp_epsilon": { - "name": "dp_epsilon", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "dp_delta": { - "name": "dp_delta", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "informed": { - "name": "informed", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "source_uri": { - "name": "source_uri", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_license": { - "name": "source_license", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_conditions_obs_geom": { - "name": "idx_conditions_obs_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_conditions_obs_domain": { - "name": "idx_conditions_obs_domain", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_dom_type": { - "name": "idx_conditions_obs_dom_type", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_severity": { - "name": "idx_conditions_obs_severity", - "columns": [ - { - "expression": "severity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_metric": { - "name": "idx_conditions_obs_metric", - "columns": [ - { - "expression": "metric", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_valid_to": { - "name": "idx_conditions_obs_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_expires": { - "name": "idx_conditions_obs_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_subject": { - "name": "idx_conditions_obs_subject", - "columns": [ - { - "expression": "subject", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_source": { - "name": "idx_conditions_obs_source", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_canonical": { - "name": "idx_conditions_obs_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_content_hash": { - "name": "idx_conditions_obs_content_hash", - "columns": [ - { - "expression": "content_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_phenomenon": { - "name": "idx_conditions_obs_phenomenon", - "columns": [ - { - "expression": "phenomenon_fingerprint", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_instance": { - "name": "idx_conditions_obs_instance", - "columns": [ - { - "expression": "instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_privacy": { - "name": "idx_conditions_obs_privacy", - "columns": [ - { - "expression": "privacy_class", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_evidence_state": { - "name": "idx_conditions_obs_evidence_state", - "columns": [ - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_flagged": { - "name": "idx_conditions_obs_flagged", - "columns": [ - { - "expression": "flagged_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observations\".\"flagged_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_corroborations": { - "name": "idx_conditions_obs_corroborations", - "columns": [ - { - "expression": "corroborations", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_replaces": { - "name": "idx_conditions_obs_replaces", - "columns": [ - { - "expression": "replaces", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "obs_confidence_score_range": { - "name": "obs_confidence_score_range", - "value": "\"conditions\".\"observations\".\"confidence_score\" IS NULL OR (\"conditions\".\"observations\".\"confidence_score\" >= 0 AND \"conditions\".\"observations\".\"confidence_score\" <= 1)" - }, - "obs_dp_epsilon_nonneg": { - "name": "obs_dp_epsilon_nonneg", - "value": "\"conditions\".\"observations\".\"dp_epsilon\" IS NULL OR \"conditions\".\"observations\".\"dp_epsilon\" >= 0" - }, - "obs_dp_delta_range": { - "name": "obs_dp_delta_range", - "value": "\"conditions\".\"observations\".\"dp_delta\" IS NULL OR (\"conditions\".\"observations\".\"dp_delta\" >= 0 AND \"conditions\".\"observations\".\"dp_delta\" < 1)" - }, - "obs_k_anonymity_positive": { - "name": "obs_k_anonymity_positive", - "value": "\"conditions\".\"observations\".\"k_anonymity\" IS NULL OR \"conditions\".\"observations\".\"k_anonymity\" > 0" - }, - "obs_severity_level_range": { - "name": "obs_severity_level_range", - "value": "\"conditions\".\"observations\".\"severity_level\" IS NULL OR (\"conditions\".\"observations\".\"severity_level\" >= 1 AND \"conditions\".\"observations\".\"severity_level\" <= 5)" - }, - "obs_fuzziness_enum": { - "name": "obs_fuzziness_enum", - "value": "\"fuzziness\" IN ('exact', 'low_res', 'medium_res', 'end_unknown', 'start_unknown', 'extent_unknown')" - }, - "obs_privacy_class_enum": { - "name": "obs_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym', 'unknown')" - }, - "obs_evidence_state_enum": { - "name": "obs_evidence_state_enum", - "value": "\"conditions\".\"observations\".\"evidence_state\" IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - }, - "obs_tombstone_reason_enum": { - "name": "obs_tombstone_reason_enum", - "value": "\"conditions\".\"observations\".\"tombstone_reason\" IS NULL OR \"conditions\".\"observations\".\"tombstone_reason\" IN ('deleted_by_source','gdpr_erasure','retracted_as_wrong','expired','legal_takedown')" - } - }, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "sensor_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_hourly": { - "name": "sensor_speed_hourly", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "speed_bins": { - "name": "speed_bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": true - }, - "speed_counts": { - "name": "speed_counts", - "type": "integer[]", - "primaryKey": false, - "notNull": true - }, - "finalized": { - "name": "finalized", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "idx_sensor_hourly_hour": { - "name": "idx_sensor_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_speed_hourly_sensor_key_hour_utc_pk": { - "name": "sensor_speed_hourly_sensor_key_hour_utc_pk", - "columns": [ - "sensor_key", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_sample": { - "name": "sensor_speed_sample", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_sample_key_bucket": { - "name": "idx_sensor_sample_key_bucket", - "columns": [ - { - "expression": "sensor_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_hour", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sensor_sample_observed": { - "name": "idx_sensor_sample_observed", - "columns": [ - { - "expression": "observed_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_sensor_sample_key_observed": { - "name": "uq_sensor_sample_key_observed", - "nullsNotDistinct": false, - "columns": [ - "sensor_key", - "observed_at" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.speed_rollup_progress": { - "name": "speed_rollup_progress", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "default": 1 - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "speed_rollup_progress_singleton": { - "name": "speed_rollup_progress_singleton", - "value": "\"conditions\".\"speed_rollup_progress\".\"id\" = 1" - } - }, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "produces": { - "name": "produces", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - }, - "source_produces_enum": { - "name": "source_produces_enum", - "value": "\"conditions\".\"source\".\"produces\" IN ('events', 'flow')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0046_snapshot.json b/packages/core/drizzle/meta/0046_snapshot.json deleted file mode 100644 index b90f269eb..000000000 --- a/packages/core/drizzle/meta/0046_snapshot.json +++ /dev/null @@ -1,5995 +0,0 @@ -{ - "id": "d17f46c0-e062-431a-aa00-c92757e94635", - "prevId": "56fc081c-b1d8-4674-be2d-d40ef70d9770", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "isExpression": true, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_observation_latest_property": { - "name": "idx_observation_latest_property", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "columnsFrom": [ - "series_id" - ], - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsTo": [ - "series_id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "columnsFrom": [ - "series_id" - ], - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsTo": [ - "series_id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gin", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "gin", - "concurrently": false - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "columnsFrom": [ - "feature_id" - ], - "tableTo": "feature", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "columnsFrom": [ - "feature_id" - ], - "tableTo": "feature", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "columnsFrom": [ - "offer_id" - ], - "tableTo": "offer", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "columnsFrom": [ - "situation_id" - ], - "tableTo": "situation", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "columnsFrom": [ - "situation_id" - ], - "tableTo": "situation", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "object_id": { - "name": "object_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_snapshot": { - "name": "payload_snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_object": { - "name": "idx_federation_outbox_object", - "columns": [ - { - "expression": "object_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observations": { - "name": "observations", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_format": { - "name": "source_format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity_source": { - "name": "severity_source", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "headline": { - "name": "headline", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "metric": { - "name": "metric", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "level": { - "name": "level", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "aggregation": { - "name": "aggregation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "subject": { - "name": "subject", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "attributes": { - "name": "attributes", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "schedule": { - "name": "schedule", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_forecast": { - "name": "is_forecast", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "related_ids": { - "name": "related_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "origin": { - "name": "origin", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "data_updated_at": { - "name": "data_updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "is_stale": { - "name": "is_stale", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "stale_after": { - "name": "stale_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "phenomenon_fingerprint": { - "name": "phenomenon_fingerprint", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "replaces": { - "name": "replaces", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "fuzziness": { - "name": "fuzziness", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'exact'" - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'unknown'" - }, - "k_anonymity": { - "name": "k_anonymity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "dp_epsilon": { - "name": "dp_epsilon", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "dp_delta": { - "name": "dp_delta", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "informed": { - "name": "informed", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "source_uri": { - "name": "source_uri", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_license": { - "name": "source_license", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_conditions_obs_geom": { - "name": "idx_conditions_obs_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_conditions_obs_domain": { - "name": "idx_conditions_obs_domain", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_dom_type": { - "name": "idx_conditions_obs_dom_type", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_severity": { - "name": "idx_conditions_obs_severity", - "columns": [ - { - "expression": "severity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_metric": { - "name": "idx_conditions_obs_metric", - "columns": [ - { - "expression": "metric", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_valid_to": { - "name": "idx_conditions_obs_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_expires": { - "name": "idx_conditions_obs_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_subject": { - "name": "idx_conditions_obs_subject", - "columns": [ - { - "expression": "subject", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gin", - "concurrently": false - }, - "idx_conditions_obs_source": { - "name": "idx_conditions_obs_source", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_canonical": { - "name": "idx_conditions_obs_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_content_hash": { - "name": "idx_conditions_obs_content_hash", - "columns": [ - { - "expression": "content_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_phenomenon": { - "name": "idx_conditions_obs_phenomenon", - "columns": [ - { - "expression": "phenomenon_fingerprint", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_instance": { - "name": "idx_conditions_obs_instance", - "columns": [ - { - "expression": "instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_privacy": { - "name": "idx_conditions_obs_privacy", - "columns": [ - { - "expression": "privacy_class", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_evidence_state": { - "name": "idx_conditions_obs_evidence_state", - "columns": [ - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_flagged": { - "name": "idx_conditions_obs_flagged", - "columns": [ - { - "expression": "flagged_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"observations\".\"flagged_at\" IS NOT NULL", - "concurrently": false - }, - "idx_conditions_obs_corroborations": { - "name": "idx_conditions_obs_corroborations", - "columns": [ - { - "expression": "corroborations", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gin", - "concurrently": false - }, - "idx_conditions_obs_replaces": { - "name": "idx_conditions_obs_replaces", - "columns": [ - { - "expression": "replaces", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gin", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "obs_confidence_score_range": { - "name": "obs_confidence_score_range", - "value": "\"conditions\".\"observations\".\"confidence_score\" IS NULL OR (\"conditions\".\"observations\".\"confidence_score\" >= 0 AND \"conditions\".\"observations\".\"confidence_score\" <= 1)" - }, - "obs_dp_epsilon_nonneg": { - "name": "obs_dp_epsilon_nonneg", - "value": "\"conditions\".\"observations\".\"dp_epsilon\" IS NULL OR \"conditions\".\"observations\".\"dp_epsilon\" >= 0" - }, - "obs_dp_delta_range": { - "name": "obs_dp_delta_range", - "value": "\"conditions\".\"observations\".\"dp_delta\" IS NULL OR (\"conditions\".\"observations\".\"dp_delta\" >= 0 AND \"conditions\".\"observations\".\"dp_delta\" < 1)" - }, - "obs_k_anonymity_positive": { - "name": "obs_k_anonymity_positive", - "value": "\"conditions\".\"observations\".\"k_anonymity\" IS NULL OR \"conditions\".\"observations\".\"k_anonymity\" > 0" - }, - "obs_severity_level_range": { - "name": "obs_severity_level_range", - "value": "\"conditions\".\"observations\".\"severity_level\" IS NULL OR (\"conditions\".\"observations\".\"severity_level\" >= 1 AND \"conditions\".\"observations\".\"severity_level\" <= 5)" - }, - "obs_fuzziness_enum": { - "name": "obs_fuzziness_enum", - "value": "\"fuzziness\" IN ('exact', 'low_res', 'medium_res', 'end_unknown', 'start_unknown', 'extent_unknown')" - }, - "obs_privacy_class_enum": { - "name": "obs_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym', 'unknown')" - }, - "obs_evidence_state_enum": { - "name": "obs_evidence_state_enum", - "value": "\"conditions\".\"observations\".\"evidence_state\" IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - }, - "obs_tombstone_reason_enum": { - "name": "obs_tombstone_reason_enum", - "value": "\"conditions\".\"observations\".\"tombstone_reason\" IS NULL OR \"conditions\".\"observations\".\"tombstone_reason\" IN ('deleted_by_source','gdpr_erasure','retracted_as_wrong','expired','legal_takedown')" - } - }, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "sensor_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_hourly": { - "name": "sensor_speed_hourly", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "speed_bins": { - "name": "speed_bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": true - }, - "speed_counts": { - "name": "speed_counts", - "type": "integer[]", - "primaryKey": false, - "notNull": true - }, - "finalized": { - "name": "finalized", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "idx_sensor_hourly_hour": { - "name": "idx_sensor_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_speed_hourly_sensor_key_hour_utc_pk": { - "name": "sensor_speed_hourly_sensor_key_hour_utc_pk", - "columns": [ - "sensor_key", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_sample": { - "name": "sensor_speed_sample", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_sample_key_bucket": { - "name": "idx_sensor_sample_key_bucket", - "columns": [ - { - "expression": "sensor_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_hour", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_sensor_sample_observed": { - "name": "idx_sensor_sample_observed", - "columns": [ - { - "expression": "observed_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_sensor_sample_key_observed": { - "name": "uq_sensor_sample_key_observed", - "columns": [ - "sensor_key", - "observed_at" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.speed_rollup_progress": { - "name": "speed_rollup_progress", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "default": 1 - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "speed_rollup_progress_singleton": { - "name": "speed_rollup_progress_singleton", - "value": "\"conditions\".\"speed_rollup_progress\".\"id\" = 1" - } - }, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "produces": { - "name": "produces", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - }, - "source_produces_enum": { - "name": "source_produces_enum", - "value": "\"conditions\".\"source\".\"produces\" IN ('events', 'flow')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "views": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0047_snapshot.json b/packages/core/drizzle/meta/0047_snapshot.json deleted file mode 100644 index 888f0742e..000000000 --- a/packages/core/drizzle/meta/0047_snapshot.json +++ /dev/null @@ -1,6046 +0,0 @@ -{ - "id": "149eed79-92fc-4bf1-82eb-ba7b6787b6b6", - "prevId": "d17f46c0-e062-431a-aa00-c92757e94635", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_observation_latest_property": { - "name": "idx_observation_latest_property", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "nullsNotDistinct": false, - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ] - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "tableTo": "offer", - "schemaTo": "conditions", - "columnsFrom": [ - "offer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observations": { - "name": "observations", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_format": { - "name": "source_format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity_source": { - "name": "severity_source", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "headline": { - "name": "headline", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "metric": { - "name": "metric", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "level": { - "name": "level", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "aggregation": { - "name": "aggregation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "subject": { - "name": "subject", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "attributes": { - "name": "attributes", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "schedule": { - "name": "schedule", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_forecast": { - "name": "is_forecast", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "related_ids": { - "name": "related_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "origin": { - "name": "origin", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "data_updated_at": { - "name": "data_updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "is_stale": { - "name": "is_stale", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "stale_after": { - "name": "stale_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "phenomenon_fingerprint": { - "name": "phenomenon_fingerprint", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "replaces": { - "name": "replaces", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "fuzziness": { - "name": "fuzziness", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'exact'" - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'unknown'" - }, - "k_anonymity": { - "name": "k_anonymity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "dp_epsilon": { - "name": "dp_epsilon", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "dp_delta": { - "name": "dp_delta", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "informed": { - "name": "informed", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "source_uri": { - "name": "source_uri", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_license": { - "name": "source_license", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_conditions_obs_geom": { - "name": "idx_conditions_obs_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_conditions_obs_domain": { - "name": "idx_conditions_obs_domain", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_dom_type": { - "name": "idx_conditions_obs_dom_type", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_severity": { - "name": "idx_conditions_obs_severity", - "columns": [ - { - "expression": "severity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_metric": { - "name": "idx_conditions_obs_metric", - "columns": [ - { - "expression": "metric", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_valid_to": { - "name": "idx_conditions_obs_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_expires": { - "name": "idx_conditions_obs_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_subject": { - "name": "idx_conditions_obs_subject", - "columns": [ - { - "expression": "subject", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_source": { - "name": "idx_conditions_obs_source", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_canonical": { - "name": "idx_conditions_obs_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_content_hash": { - "name": "idx_conditions_obs_content_hash", - "columns": [ - { - "expression": "content_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_phenomenon": { - "name": "idx_conditions_obs_phenomenon", - "columns": [ - { - "expression": "phenomenon_fingerprint", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_instance": { - "name": "idx_conditions_obs_instance", - "columns": [ - { - "expression": "instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_privacy": { - "name": "idx_conditions_obs_privacy", - "columns": [ - { - "expression": "privacy_class", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_evidence_state": { - "name": "idx_conditions_obs_evidence_state", - "columns": [ - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_flagged": { - "name": "idx_conditions_obs_flagged", - "columns": [ - { - "expression": "flagged_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observations\".\"flagged_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_corroborations": { - "name": "idx_conditions_obs_corroborations", - "columns": [ - { - "expression": "corroborations", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_replaces": { - "name": "idx_conditions_obs_replaces", - "columns": [ - { - "expression": "replaces", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "obs_confidence_score_range": { - "name": "obs_confidence_score_range", - "value": "\"conditions\".\"observations\".\"confidence_score\" IS NULL OR (\"conditions\".\"observations\".\"confidence_score\" >= 0 AND \"conditions\".\"observations\".\"confidence_score\" <= 1)" - }, - "obs_dp_epsilon_nonneg": { - "name": "obs_dp_epsilon_nonneg", - "value": "\"conditions\".\"observations\".\"dp_epsilon\" IS NULL OR \"conditions\".\"observations\".\"dp_epsilon\" >= 0" - }, - "obs_dp_delta_range": { - "name": "obs_dp_delta_range", - "value": "\"conditions\".\"observations\".\"dp_delta\" IS NULL OR (\"conditions\".\"observations\".\"dp_delta\" >= 0 AND \"conditions\".\"observations\".\"dp_delta\" < 1)" - }, - "obs_k_anonymity_positive": { - "name": "obs_k_anonymity_positive", - "value": "\"conditions\".\"observations\".\"k_anonymity\" IS NULL OR \"conditions\".\"observations\".\"k_anonymity\" > 0" - }, - "obs_severity_level_range": { - "name": "obs_severity_level_range", - "value": "\"conditions\".\"observations\".\"severity_level\" IS NULL OR (\"conditions\".\"observations\".\"severity_level\" >= 1 AND \"conditions\".\"observations\".\"severity_level\" <= 5)" - }, - "obs_fuzziness_enum": { - "name": "obs_fuzziness_enum", - "value": "\"fuzziness\" IN ('exact', 'low_res', 'medium_res', 'end_unknown', 'start_unknown', 'extent_unknown')" - }, - "obs_privacy_class_enum": { - "name": "obs_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym', 'unknown')" - }, - "obs_evidence_state_enum": { - "name": "obs_evidence_state_enum", - "value": "\"conditions\".\"observations\".\"evidence_state\" IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - }, - "obs_tombstone_reason_enum": { - "name": "obs_tombstone_reason_enum", - "value": "\"conditions\".\"observations\".\"tombstone_reason\" IS NULL OR \"conditions\".\"observations\".\"tombstone_reason\" IN ('deleted_by_source','gdpr_erasure','retracted_as_wrong','expired','legal_takedown')" - } - }, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "sensor_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_hourly": { - "name": "sensor_speed_hourly", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "speed_bins": { - "name": "speed_bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": true - }, - "speed_counts": { - "name": "speed_counts", - "type": "integer[]", - "primaryKey": false, - "notNull": true - }, - "finalized": { - "name": "finalized", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "idx_sensor_hourly_hour": { - "name": "idx_sensor_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_speed_hourly_sensor_key_hour_utc_pk": { - "name": "sensor_speed_hourly_sensor_key_hour_utc_pk", - "columns": [ - "sensor_key", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_sample": { - "name": "sensor_speed_sample", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_sample_key_bucket": { - "name": "idx_sensor_sample_key_bucket", - "columns": [ - { - "expression": "sensor_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_hour", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sensor_sample_observed": { - "name": "idx_sensor_sample_observed", - "columns": [ - { - "expression": "observed_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_sensor_sample_key_observed": { - "name": "uq_sensor_sample_key_observed", - "nullsNotDistinct": false, - "columns": [ - "sensor_key", - "observed_at" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.speed_rollup_progress": { - "name": "speed_rollup_progress", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "default": 1 - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "speed_rollup_progress_singleton": { - "name": "speed_rollup_progress_singleton", - "value": "\"conditions\".\"speed_rollup_progress\".\"id\" = 1" - } - }, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "produces": { - "name": "produces", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - }, - "source_produces_enum": { - "name": "source_produces_enum", - "value": "\"conditions\".\"source\".\"produces\" IN ('events', 'flow')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0048_snapshot.json b/packages/core/drizzle/meta/0048_snapshot.json deleted file mode 100644 index 7c85a3383..000000000 --- a/packages/core/drizzle/meta/0048_snapshot.json +++ /dev/null @@ -1,6046 +0,0 @@ -{ - "id": "d35337c0-1c85-40cc-9d4b-271bb6cc4f85", - "prevId": "149eed79-92fc-4bf1-82eb-ba7b6787b6b6", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "isExpression": true, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_observation_latest_property": { - "name": "idx_observation_latest_property", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "columnsFrom": [ - "series_id" - ], - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsTo": [ - "series_id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "columnsFrom": [ - "series_id" - ], - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsTo": [ - "series_id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gin", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "gin", - "concurrently": false - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "columnsFrom": [ - "feature_id" - ], - "tableTo": "feature", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "columnsFrom": [ - "feature_id" - ], - "tableTo": "feature", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "columnsFrom": [ - "offer_id" - ], - "tableTo": "offer", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "columnsFrom": [ - "situation_id" - ], - "tableTo": "situation", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "columnsFrom": [ - "situation_id" - ], - "tableTo": "situation", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observations": { - "name": "observations", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_format": { - "name": "source_format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity_source": { - "name": "severity_source", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "headline": { - "name": "headline", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "metric": { - "name": "metric", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "level": { - "name": "level", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "aggregation": { - "name": "aggregation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "subject": { - "name": "subject", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "attributes": { - "name": "attributes", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "schedule": { - "name": "schedule", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_forecast": { - "name": "is_forecast", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "related_ids": { - "name": "related_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "origin": { - "name": "origin", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "data_updated_at": { - "name": "data_updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "is_stale": { - "name": "is_stale", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "stale_after": { - "name": "stale_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "phenomenon_fingerprint": { - "name": "phenomenon_fingerprint", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "replaces": { - "name": "replaces", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "fuzziness": { - "name": "fuzziness", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'exact'" - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'unknown'" - }, - "k_anonymity": { - "name": "k_anonymity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "dp_epsilon": { - "name": "dp_epsilon", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "dp_delta": { - "name": "dp_delta", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "informed": { - "name": "informed", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "source_uri": { - "name": "source_uri", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_license": { - "name": "source_license", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_conditions_obs_geom": { - "name": "idx_conditions_obs_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_conditions_obs_domain": { - "name": "idx_conditions_obs_domain", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_dom_type": { - "name": "idx_conditions_obs_dom_type", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_severity": { - "name": "idx_conditions_obs_severity", - "columns": [ - { - "expression": "severity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_metric": { - "name": "idx_conditions_obs_metric", - "columns": [ - { - "expression": "metric", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_valid_to": { - "name": "idx_conditions_obs_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_expires": { - "name": "idx_conditions_obs_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_subject": { - "name": "idx_conditions_obs_subject", - "columns": [ - { - "expression": "subject", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gin", - "concurrently": false - }, - "idx_conditions_obs_source": { - "name": "idx_conditions_obs_source", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_canonical": { - "name": "idx_conditions_obs_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_content_hash": { - "name": "idx_conditions_obs_content_hash", - "columns": [ - { - "expression": "content_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_phenomenon": { - "name": "idx_conditions_obs_phenomenon", - "columns": [ - { - "expression": "phenomenon_fingerprint", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_instance": { - "name": "idx_conditions_obs_instance", - "columns": [ - { - "expression": "instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_privacy": { - "name": "idx_conditions_obs_privacy", - "columns": [ - { - "expression": "privacy_class", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_evidence_state": { - "name": "idx_conditions_obs_evidence_state", - "columns": [ - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_conditions_obs_flagged": { - "name": "idx_conditions_obs_flagged", - "columns": [ - { - "expression": "flagged_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"observations\".\"flagged_at\" IS NOT NULL", - "concurrently": false - }, - "idx_conditions_obs_corroborations": { - "name": "idx_conditions_obs_corroborations", - "columns": [ - { - "expression": "corroborations", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gin", - "concurrently": false - }, - "idx_conditions_obs_replaces": { - "name": "idx_conditions_obs_replaces", - "columns": [ - { - "expression": "replaces", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gin", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "obs_confidence_score_range": { - "name": "obs_confidence_score_range", - "value": "\"conditions\".\"observations\".\"confidence_score\" IS NULL OR (\"conditions\".\"observations\".\"confidence_score\" >= 0 AND \"conditions\".\"observations\".\"confidence_score\" <= 1)" - }, - "obs_dp_epsilon_nonneg": { - "name": "obs_dp_epsilon_nonneg", - "value": "\"conditions\".\"observations\".\"dp_epsilon\" IS NULL OR \"conditions\".\"observations\".\"dp_epsilon\" >= 0" - }, - "obs_dp_delta_range": { - "name": "obs_dp_delta_range", - "value": "\"conditions\".\"observations\".\"dp_delta\" IS NULL OR (\"conditions\".\"observations\".\"dp_delta\" >= 0 AND \"conditions\".\"observations\".\"dp_delta\" < 1)" - }, - "obs_k_anonymity_positive": { - "name": "obs_k_anonymity_positive", - "value": "\"conditions\".\"observations\".\"k_anonymity\" IS NULL OR \"conditions\".\"observations\".\"k_anonymity\" > 0" - }, - "obs_severity_level_range": { - "name": "obs_severity_level_range", - "value": "\"conditions\".\"observations\".\"severity_level\" IS NULL OR (\"conditions\".\"observations\".\"severity_level\" >= 1 AND \"conditions\".\"observations\".\"severity_level\" <= 5)" - }, - "obs_fuzziness_enum": { - "name": "obs_fuzziness_enum", - "value": "\"fuzziness\" IN ('exact', 'low_res', 'medium_res', 'end_unknown', 'start_unknown', 'extent_unknown')" - }, - "obs_privacy_class_enum": { - "name": "obs_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym', 'unknown')" - }, - "obs_evidence_state_enum": { - "name": "obs_evidence_state_enum", - "value": "\"conditions\".\"observations\".\"evidence_state\" IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - }, - "obs_tombstone_reason_enum": { - "name": "obs_tombstone_reason_enum", - "value": "\"conditions\".\"observations\".\"tombstone_reason\" IS NULL OR \"conditions\".\"observations\".\"tombstone_reason\" IN ('deleted_by_source','gdpr_erasure','retracted_as_wrong','expired','legal_takedown')" - } - }, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "sensor_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_hourly": { - "name": "sensor_speed_hourly", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "speed_bins": { - "name": "speed_bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": true - }, - "speed_counts": { - "name": "speed_counts", - "type": "integer[]", - "primaryKey": false, - "notNull": true - }, - "finalized": { - "name": "finalized", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "idx_sensor_hourly_hour": { - "name": "idx_sensor_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_speed_hourly_sensor_key_hour_utc_pk": { - "name": "sensor_speed_hourly_sensor_key_hour_utc_pk", - "columns": [ - "sensor_key", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_sample": { - "name": "sensor_speed_sample", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_sample_key_bucket": { - "name": "idx_sensor_sample_key_bucket", - "columns": [ - { - "expression": "sensor_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_hour", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_sensor_sample_observed": { - "name": "idx_sensor_sample_observed", - "columns": [ - { - "expression": "observed_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_sensor_sample_key_observed": { - "name": "uq_sensor_sample_key_observed", - "columns": [ - "sensor_key", - "observed_at" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.speed_rollup_progress": { - "name": "speed_rollup_progress", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "default": 1 - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "speed_rollup_progress_singleton": { - "name": "speed_rollup_progress_singleton", - "value": "\"conditions\".\"speed_rollup_progress\".\"id\" = 1" - } - }, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "produces": { - "name": "produces", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - }, - "source_produces_enum": { - "name": "source_produces_enum", - "value": "\"conditions\".\"source\".\"produces\" IN ('events', 'flow')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "views": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0049_snapshot.json b/packages/core/drizzle/meta/0049_snapshot.json deleted file mode 100644 index 4195819f6..000000000 --- a/packages/core/drizzle/meta/0049_snapshot.json +++ /dev/null @@ -1,6061 +0,0 @@ -{ - "id": "b0a3b4e8-dbdd-4699-ae22-18679323092b", - "prevId": "d35337c0-1c85-40cc-9d4b-271bb6cc4f85", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_observation_latest_property": { - "name": "idx_observation_latest_property", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "nullsNotDistinct": false, - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ] - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "tableTo": "offer", - "schemaTo": "conditions", - "columnsFrom": [ - "offer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observations": { - "name": "observations", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_format": { - "name": "source_format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "severity_source": { - "name": "severity_source", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "headline": { - "name": "headline", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "metric": { - "name": "metric", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "level": { - "name": "level", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "aggregation": { - "name": "aggregation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "subject": { - "name": "subject", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "attributes": { - "name": "attributes", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "schedule": { - "name": "schedule", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_forecast": { - "name": "is_forecast", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "related_ids": { - "name": "related_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "origin": { - "name": "origin", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "data_updated_at": { - "name": "data_updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "is_stale": { - "name": "is_stale", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "stale_after": { - "name": "stale_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "phenomenon_fingerprint": { - "name": "phenomenon_fingerprint", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "replaces": { - "name": "replaces", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "fuzziness": { - "name": "fuzziness", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'exact'" - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'unknown'" - }, - "k_anonymity": { - "name": "k_anonymity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "dp_epsilon": { - "name": "dp_epsilon", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "dp_delta": { - "name": "dp_delta", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "informed": { - "name": "informed", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "source_uri": { - "name": "source_uri", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_license": { - "name": "source_license", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_conditions_obs_geom": { - "name": "idx_conditions_obs_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_conditions_obs_domain": { - "name": "idx_conditions_obs_domain", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_dom_type": { - "name": "idx_conditions_obs_dom_type", - "columns": [ - { - "expression": "domain", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_severity": { - "name": "idx_conditions_obs_severity", - "columns": [ - { - "expression": "severity", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_metric": { - "name": "idx_conditions_obs_metric", - "columns": [ - { - "expression": "metric", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_valid_to": { - "name": "idx_conditions_obs_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_expires": { - "name": "idx_conditions_obs_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_subject": { - "name": "idx_conditions_obs_subject", - "columns": [ - { - "expression": "subject", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_source": { - "name": "idx_conditions_obs_source", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_canonical": { - "name": "idx_conditions_obs_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_content_hash": { - "name": "idx_conditions_obs_content_hash", - "columns": [ - { - "expression": "content_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_phenomenon": { - "name": "idx_conditions_obs_phenomenon", - "columns": [ - { - "expression": "phenomenon_fingerprint", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_instance": { - "name": "idx_conditions_obs_instance", - "columns": [ - { - "expression": "instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_privacy": { - "name": "idx_conditions_obs_privacy", - "columns": [ - { - "expression": "privacy_class", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_evidence_state": { - "name": "idx_conditions_obs_evidence_state", - "columns": [ - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_flagged": { - "name": "idx_conditions_obs_flagged", - "columns": [ - { - "expression": "flagged_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observations\".\"flagged_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_conditions_obs_corroborations": { - "name": "idx_conditions_obs_corroborations", - "columns": [ - { - "expression": "corroborations", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "idx_conditions_obs_replaces": { - "name": "idx_conditions_obs_replaces", - "columns": [ - { - "expression": "replaces", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "obs_confidence_score_range": { - "name": "obs_confidence_score_range", - "value": "\"conditions\".\"observations\".\"confidence_score\" IS NULL OR (\"conditions\".\"observations\".\"confidence_score\" >= 0 AND \"conditions\".\"observations\".\"confidence_score\" <= 1)" - }, - "obs_dp_epsilon_nonneg": { - "name": "obs_dp_epsilon_nonneg", - "value": "\"conditions\".\"observations\".\"dp_epsilon\" IS NULL OR \"conditions\".\"observations\".\"dp_epsilon\" >= 0" - }, - "obs_dp_delta_range": { - "name": "obs_dp_delta_range", - "value": "\"conditions\".\"observations\".\"dp_delta\" IS NULL OR (\"conditions\".\"observations\".\"dp_delta\" >= 0 AND \"conditions\".\"observations\".\"dp_delta\" < 1)" - }, - "obs_k_anonymity_positive": { - "name": "obs_k_anonymity_positive", - "value": "\"conditions\".\"observations\".\"k_anonymity\" IS NULL OR \"conditions\".\"observations\".\"k_anonymity\" > 0" - }, - "obs_severity_level_range": { - "name": "obs_severity_level_range", - "value": "\"conditions\".\"observations\".\"severity_level\" IS NULL OR (\"conditions\".\"observations\".\"severity_level\" >= 1 AND \"conditions\".\"observations\".\"severity_level\" <= 5)" - }, - "obs_fuzziness_enum": { - "name": "obs_fuzziness_enum", - "value": "\"fuzziness\" IN ('exact', 'low_res', 'medium_res', 'end_unknown', 'start_unknown', 'extent_unknown')" - }, - "obs_privacy_class_enum": { - "name": "obs_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym', 'unknown')" - }, - "obs_evidence_state_enum": { - "name": "obs_evidence_state_enum", - "value": "\"conditions\".\"observations\".\"evidence_state\" IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - }, - "obs_tombstone_reason_enum": { - "name": "obs_tombstone_reason_enum", - "value": "\"conditions\".\"observations\".\"tombstone_reason\" IS NULL OR \"conditions\".\"observations\".\"tombstone_reason\" IN ('deleted_by_source','gdpr_erasure','retracted_as_wrong','expired','legal_takedown')" - } - }, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_sensor_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "sensor_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_hourly": { - "name": "sensor_speed_hourly", - "schema": "conditions", - "columns": { - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "speed_bins": { - "name": "speed_bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": true - }, - "speed_counts": { - "name": "speed_counts", - "type": "integer[]", - "primaryKey": false, - "notNull": true - }, - "finalized": { - "name": "finalized", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "idx_sensor_hourly_hour": { - "name": "idx_sensor_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_speed_hourly_sensor_key_hour_utc_pk": { - "name": "sensor_speed_hourly_sensor_key_hour_utc_pk", - "columns": [ - "sensor_key", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_speed_sample": { - "name": "sensor_speed_sample", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "sensor_key": { - "name": "sensor_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_sample_key_bucket": { - "name": "idx_sensor_sample_key_bucket", - "columns": [ - { - "expression": "sensor_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_hour", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sensor_sample_observed": { - "name": "idx_sensor_sample_observed", - "columns": [ - { - "expression": "observed_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "uq_sensor_sample_key_observed": { - "name": "uq_sensor_sample_key_observed", - "nullsNotDistinct": false, - "columns": [ - "sensor_key", - "observed_at" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.speed_rollup_progress": { - "name": "speed_rollup_progress", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "default": 1 - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "speed_rollup_progress_singleton": { - "name": "speed_rollup_progress_singleton", - "value": "\"conditions\".\"speed_rollup_progress\".\"id\" = 1" - } - }, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "produces": { - "name": "produces", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - }, - "source_produces_enum": { - "name": "source_produces_enum", - "value": "\"conditions\".\"source\".\"produces\" IN ('events', 'flow')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0050_snapshot.json b/packages/core/drizzle/meta/0050_snapshot.json deleted file mode 100644 index 262d74648..000000000 --- a/packages/core/drizzle/meta/0050_snapshot.json +++ /dev/null @@ -1,5173 +0,0 @@ -{ - "id": "f8227d32-6aeb-4c76-a023-67c5ca274327", - "prevId": "b0a3b4e8-dbdd-4699-ae22-18679323092b", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_observation_latest_property": { - "name": "idx_observation_latest_property", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "nullsNotDistinct": false, - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ] - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "tableTo": "offer", - "schemaTo": "conditions", - "columnsFrom": [ - "offer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "produces": { - "name": "produces", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - }, - "source_produces_enum": { - "name": "source_produces_enum", - "value": "\"conditions\".\"source\".\"produces\" IN ('events', 'flow')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0051_snapshot.json b/packages/core/drizzle/meta/0051_snapshot.json deleted file mode 100644 index 69d4a0101..000000000 --- a/packages/core/drizzle/meta/0051_snapshot.json +++ /dev/null @@ -1,5234 +0,0 @@ -{ - "id": "5c3cb34a-9d90-483e-afbf-222f7765078b", - "prevId": "f8227d32-6aeb-4c76-a023-67c5ca274327", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_observation_latest_property": { - "name": "idx_observation_latest_property", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "(\"record\" ->> 'id')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"source_id\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "nullsNotDistinct": false, - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ] - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "tableTo": "offer", - "schemaTo": "conditions", - "columnsFrom": [ - "offer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "produces": { - "name": "produces", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - }, - "source_produces_enum": { - "name": "source_produces_enum", - "value": "\"conditions\".\"source\".\"produces\" IN ('events', 'flow')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0052_snapshot.json b/packages/core/drizzle/meta/0052_snapshot.json deleted file mode 100644 index 4bf017a04..000000000 --- a/packages/core/drizzle/meta/0052_snapshot.json +++ /dev/null @@ -1,5234 +0,0 @@ -{ - "id": "3f53c563-5d42-4767-b455-6f6dd02c1eb0", - "prevId": "5c3cb34a-9d90-483e-afbf-222f7765078b", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "isExpression": true, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_observation_latest_property": { - "name": "idx_observation_latest_property", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "(\"record\" ->> 'id')", - "isExpression": true, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"observation_latest\".\"source_id\" = 'crowd'", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "columnsFrom": [ - "series_id" - ], - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsTo": [ - "series_id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "columnsFrom": [ - "series_id" - ], - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsTo": [ - "series_id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "isExpression": true, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gin", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gin", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "gin", - "concurrently": false - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "columnsFrom": [ - "feature_id" - ], - "tableTo": "feature", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "columnsFrom": [ - "feature_id" - ], - "tableTo": "feature", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "columnsFrom": [ - "offer_id" - ], - "tableTo": "offer", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "columnsFrom": [ - "situation_id" - ], - "tableTo": "situation", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "columnsFrom": [ - "situation_id" - ], - "tableTo": "situation", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "produces": { - "name": "produces", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - }, - "source_produces_enum": { - "name": "source_produces_enum", - "value": "\"conditions\".\"source\".\"produces\" IN ('events', 'flow')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "views": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0053_snapshot.json b/packages/core/drizzle/meta/0053_snapshot.json deleted file mode 100644 index bf05f4628..000000000 --- a/packages/core/drizzle/meta/0053_snapshot.json +++ /dev/null @@ -1,5234 +0,0 @@ -{ - "id": "7b60411d-6e08-4a3d-a5d0-abc03f090991", - "prevId": "3f53c563-5d42-4767-b455-6f6dd02c1eb0", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "isExpression": true, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_observation_latest_property": { - "name": "idx_observation_latest_property", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "(\"record\" ->> 'id')", - "isExpression": true, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"observation_latest\".\"source_id\" = 'crowd'", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "columnsFrom": [ - "series_id" - ], - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsTo": [ - "series_id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "columnsFrom": [ - "series_id" - ], - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsTo": [ - "series_id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "isExpression": true, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gin", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gin", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "gin", - "concurrently": false - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "columnsFrom": [ - "feature_id" - ], - "tableTo": "feature", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "columnsFrom": [ - "feature_id" - ], - "tableTo": "feature", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "columnsFrom": [ - "offer_id" - ], - "tableTo": "offer", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "columnsFrom": [ - "situation_id" - ], - "tableTo": "situation", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "columnsFrom": [ - "situation_id" - ], - "tableTo": "situation", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "produces": { - "name": "produces", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - }, - "source_produces_enum": { - "name": "source_produces_enum", - "value": "\"conditions\".\"source\".\"produces\" IN ('events', 'flow')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "views": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0054_snapshot.json b/packages/core/drizzle/meta/0054_snapshot.json deleted file mode 100644 index 02a9b00a0..000000000 --- a/packages/core/drizzle/meta/0054_snapshot.json +++ /dev/null @@ -1,5240 +0,0 @@ -{ - "id": "21750165-2a70-4589-a15c-9fab16d175a4", - "prevId": "7b60411d-6e08-4a3d-a5d0-abc03f090991", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "reading": { - "name": "reading", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template_hash": { - "name": "template_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_observation_latest_property": { - "name": "idx_observation_latest_property", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "(\"reading\" ->> 'id')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"source_id\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "nullsNotDistinct": false, - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ] - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "tableTo": "offer", - "schemaTo": "conditions", - "columnsFrom": [ - "offer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "produces": { - "name": "produces", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - }, - "source_produces_enum": { - "name": "source_produces_enum", - "value": "\"conditions\".\"source\".\"produces\" IN ('events', 'flow')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0055_snapshot.json b/packages/core/drizzle/meta/0055_snapshot.json deleted file mode 100644 index 294b90fa1..000000000 --- a/packages/core/drizzle/meta/0055_snapshot.json +++ /dev/null @@ -1,5240 +0,0 @@ -{ - "id": "46b70f91-25ee-4954-9218-58f3442948df", - "prevId": "21750165-2a70-4589-a15c-9fab16d175a4", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "isExpression": true, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "reading": { - "name": "reading", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template_hash": { - "name": "template_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_observation_latest_property": { - "name": "idx_observation_latest_property", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "(\"reading\" ->> 'id')", - "isExpression": true, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"observation_latest\".\"source_id\" = 'crowd'", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "columnsFrom": [ - "series_id" - ], - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsTo": [ - "series_id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "columnsFrom": [ - "series_id" - ], - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsTo": [ - "series_id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "isExpression": true, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gin", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gin", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "gin", - "concurrently": false - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "columnsFrom": [ - "feature_id" - ], - "tableTo": "feature", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "columnsFrom": [ - "feature_id" - ], - "tableTo": "feature", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "columnsFrom": [ - "offer_id" - ], - "tableTo": "offer", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "columnsFrom": [ - "situation_id" - ], - "tableTo": "situation", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "columnsFrom": [ - "situation_id" - ], - "tableTo": "situation", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "produces": { - "name": "produces", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - }, - "source_produces_enum": { - "name": "source_produces_enum", - "value": "\"conditions\".\"source\".\"produces\" IN ('events', 'flow')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "views": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0056_snapshot.json b/packages/core/drizzle/meta/0056_snapshot.json deleted file mode 100644 index 3a0b794b6..000000000 --- a/packages/core/drizzle/meta/0056_snapshot.json +++ /dev/null @@ -1,5240 +0,0 @@ -{ - "id": "795abd04-3c94-44d1-aa21-272179f9d420", - "prevId": "46b70f91-25ee-4954-9218-58f3442948df", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "isExpression": true, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "reading": { - "name": "reading", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template_hash": { - "name": "template_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_observation_latest_property": { - "name": "idx_observation_latest_property", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "(\"reading\" ->> 'id')", - "isExpression": true, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"observation_latest\".\"source_id\" = 'crowd'", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "columnsFrom": [ - "series_id" - ], - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsTo": [ - "series_id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "columnsFrom": [ - "series_id" - ], - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsTo": [ - "series_id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "isExpression": true, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gin", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gin", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "gin", - "concurrently": false - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "columnsFrom": [ - "feature_id" - ], - "tableTo": "feature", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "columnsFrom": [ - "feature_id" - ], - "tableTo": "feature", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "columnsFrom": [ - "offer_id" - ], - "tableTo": "offer", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "columnsFrom": [ - "situation_id" - ], - "tableTo": "situation", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "columnsFrom": [ - "situation_id" - ], - "tableTo": "situation", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "produces": { - "name": "produces", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - }, - "source_produces_enum": { - "name": "source_produces_enum", - "value": "\"conditions\".\"source\".\"produces\" IN ('events', 'flow')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "views": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0057_snapshot.json b/packages/core/drizzle/meta/0057_snapshot.json deleted file mode 100644 index e5fcbc613..000000000 --- a/packages/core/drizzle/meta/0057_snapshot.json +++ /dev/null @@ -1,5246 +0,0 @@ -{ - "id": "8129e1c5-320c-48da-9a1f-bbc3fb1fb02d", - "prevId": "795abd04-3c94-44d1-aa21-272179f9d420", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "reading": { - "name": "reading", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template_hash": { - "name": "template_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "crowd_record_id": { - "name": "crowd_record_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_observation_latest_property": { - "name": "idx_observation_latest_property", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "crowd_record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"crowd_record_id\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "nullsNotDistinct": false, - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ] - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "tableTo": "offer", - "schemaTo": "conditions", - "columnsFrom": [ - "offer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "produces": { - "name": "produces", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - }, - "source_produces_enum": { - "name": "source_produces_enum", - "value": "\"conditions\".\"source\".\"produces\" IN ('events', 'flow')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0058_snapshot.json b/packages/core/drizzle/meta/0058_snapshot.json deleted file mode 100644 index 458512822..000000000 --- a/packages/core/drizzle/meta/0058_snapshot.json +++ /dev/null @@ -1,5246 +0,0 @@ -{ - "id": "5ea8ac93-4478-46d0-b446-54d0781a9e2b", - "prevId": "8129e1c5-320c-48da-9a1f-bbc3fb1fb02d", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "reading": { - "name": "reading", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template_hash": { - "name": "template_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "crowd_record_id": { - "name": "crowd_record_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_source": { - "name": "idx_observation_latest_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "crowd_record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"crowd_record_id\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "nullsNotDistinct": false, - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ] - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "tableTo": "offer", - "schemaTo": "conditions", - "columnsFrom": [ - "offer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "produces": { - "name": "produces", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - }, - "source_produces_enum": { - "name": "source_produces_enum", - "value": "\"conditions\".\"source\".\"produces\" IN ('events', 'flow')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0059_snapshot.json b/packages/core/drizzle/meta/0059_snapshot.json deleted file mode 100644 index 2360c95e9..000000000 --- a/packages/core/drizzle/meta/0059_snapshot.json +++ /dev/null @@ -1,5272 +0,0 @@ -{ - "id": "629b633c-3018-4098-bf12-a4e9deadc4bc", - "prevId": "5ea8ac93-4478-46d0-b446-54d0781a9e2b", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "reading": { - "name": "reading", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template_hash": { - "name": "template_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "crowd_record_id": { - "name": "crowd_record_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_source": { - "name": "idx_observation_latest_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "crowd_record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"crowd_record_id\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "nullsNotDistinct": false, - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ] - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "tableTo": "offer", - "schemaTo": "conditions", - "columnsFrom": [ - "offer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_erasure": { - "name": "archive_erasure", - "schema": "conditions", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "applied_at": { - "name": "applied_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "produces": { - "name": "produces", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - }, - "source_produces_enum": { - "name": "source_produces_enum", - "value": "\"conditions\".\"source\".\"produces\" IN ('events', 'flow')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0060_snapshot.json b/packages/core/drizzle/meta/0060_snapshot.json deleted file mode 100644 index 0a49af45a..000000000 --- a/packages/core/drizzle/meta/0060_snapshot.json +++ /dev/null @@ -1,5268 +0,0 @@ -{ - "id": "83849880-bdad-408a-ab08-62321dee4abe", - "prevId": "629b633c-3018-4098-bf12-a4e9deadc4bc", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "reading": { - "name": "reading", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template_hash": { - "name": "template_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "crowd_record_id": { - "name": "crowd_record_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_source": { - "name": "idx_observation_latest_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "crowd_record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"crowd_record_id\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "nullsNotDistinct": false, - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ] - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "tableTo": "offer", - "schemaTo": "conditions", - "columnsFrom": [ - "offer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_erasure": { - "name": "archive_erasure", - "schema": "conditions", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "applied_at": { - "name": "applied_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "product": { - "name": "product", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0061_snapshot.json b/packages/core/drizzle/meta/0061_snapshot.json deleted file mode 100644 index 069563702..000000000 --- a/packages/core/drizzle/meta/0061_snapshot.json +++ /dev/null @@ -1,5487 +0,0 @@ -{ - "id": "e6f64f64-f704-4b5d-8adc-6cf31d41006f", - "prevId": "83849880-bdad-408a-ab08-62321dee4abe", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "reading": { - "name": "reading", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template_hash": { - "name": "template_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "crowd_record_id": { - "name": "crowd_record_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_sources": { - "name": "fused_sources", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_public": { - "name": "fused_public", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_source": { - "name": "idx_observation_latest_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "series_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "crowd_record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"crowd_record_id\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "nullsNotDistinct": false, - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ] - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "tableTo": "offer", - "schemaTo": "conditions", - "columnsFrom": [ - "offer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_erasure": { - "name": "archive_erasure", - "schema": "conditions", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "applied_at": { - "name": "applied_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.on_demand_fetch": { - "name": "on_demand_fetch", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "retry_at": { - "name": "retry_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "claimed_until": { - "name": "claimed_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "on_demand_fetch_source_id_cell_pk": { - "name": "on_demand_fetch_source_id_cell_pk", - "columns": [ - "source_id", - "cell" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "on_demand_fetch_status_enum": { - "name": "on_demand_fetch_status_enum", - "value": "\"conditions\".\"on_demand_fetch\".\"status\" IN ('pending','fresh','failed')" - } - }, - "isRLSEnabled": false - }, - "conditions.on_demand_quota": { - "name": "on_demand_quota", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "tokens": { - "name": "tokens", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "refilled_at": { - "name": "refilled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "day": { - "name": "day", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "day_count": { - "name": "day_count", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "product": { - "name": "product", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "restricted": { - "name": "restricted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restricted_since": { - "name": "restricted_since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fusion_restricted": { - "name": "fusion_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "fusion_tier": { - "name": "fusion_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "fusion_licenses": { - "name": "fusion_licenses", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "federation_restricted": { - "name": "federation_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "federation_pending": { - "name": "federation_pending", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0062_snapshot.json b/packages/core/drizzle/meta/0062_snapshot.json deleted file mode 100644 index e424132c5..000000000 --- a/packages/core/drizzle/meta/0062_snapshot.json +++ /dev/null @@ -1,5487 +0,0 @@ -{ - "id": "84cf443b-8843-40f1-aafa-a23c522a5352", - "prevId": "e6f64f64-f704-4b5d-8adc-6cf31d41006f", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "isExpression": true, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "reading": { - "name": "reading", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template_hash": { - "name": "template_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "crowd_record_id": { - "name": "crowd_record_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_sources": { - "name": "fused_sources", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_public": { - "name": "fused_public", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_observation_latest_source": { - "name": "idx_observation_latest_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "series_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "crowd_record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"observation_latest\".\"crowd_record_id\" IS NOT NULL", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "columnsFrom": [ - "series_id" - ], - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsTo": [ - "series_id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "columnsFrom": [ - "series_id" - ], - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsTo": [ - "series_id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "isExpression": true, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gin", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gin", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "gin", - "concurrently": false - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "columnsFrom": [ - "feature_id" - ], - "tableTo": "feature", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "columnsFrom": [ - "feature_id" - ], - "tableTo": "feature", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "columnsFrom": [ - "offer_id" - ], - "tableTo": "offer", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "columnsFrom": [ - "situation_id" - ], - "tableTo": "situation", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "columnsFrom": [ - "situation_id" - ], - "tableTo": "situation", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_erasure": { - "name": "archive_erasure", - "schema": "conditions", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "applied_at": { - "name": "applied_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.on_demand_fetch": { - "name": "on_demand_fetch", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "retry_at": { - "name": "retry_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "claimed_until": { - "name": "claimed_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "on_demand_fetch_source_id_cell_pk": { - "name": "on_demand_fetch_source_id_cell_pk", - "columns": [ - "source_id", - "cell" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "on_demand_fetch_status_enum": { - "name": "on_demand_fetch_status_enum", - "value": "\"conditions\".\"on_demand_fetch\".\"status\" IN ('pending','fresh','failed')" - } - }, - "isRLSEnabled": false - }, - "conditions.on_demand_quota": { - "name": "on_demand_quota", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "tokens": { - "name": "tokens", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "refilled_at": { - "name": "refilled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "day": { - "name": "day", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "day_count": { - "name": "day_count", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "product": { - "name": "product", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "restricted": { - "name": "restricted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restricted_since": { - "name": "restricted_since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fusion_restricted": { - "name": "fusion_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "fusion_tier": { - "name": "fusion_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "fusion_licenses": { - "name": "fusion_licenses", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "federation_restricted": { - "name": "federation_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "federation_pending": { - "name": "federation_pending", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "views": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0063_snapshot.json b/packages/core/drizzle/meta/0063_snapshot.json deleted file mode 100644 index cc767355a..000000000 --- a/packages/core/drizzle/meta/0063_snapshot.json +++ /dev/null @@ -1,5526 +0,0 @@ -{ - "id": "461c1d1c-ac45-4203-93f9-4472bc6ae093", - "prevId": "84cf443b-8843-40f1-aafa-a23c522a5352", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "reading": { - "name": "reading", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template_hash": { - "name": "template_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "crowd_record_id": { - "name": "crowd_record_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_sources": { - "name": "fused_sources", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_public": { - "name": "fused_public", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_source": { - "name": "idx_observation_latest_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "series_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "crowd_record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"crowd_record_id\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "nullsNotDistinct": false, - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ] - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "tableTo": "offer", - "schemaTo": "conditions", - "columnsFrom": [ - "offer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_erasure": { - "name": "archive_erasure", - "schema": "conditions", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "applied_at": { - "name": "applied_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_source_receipt": { - "name": "federation_source_receipt", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_received_at": { - "name": "last_received_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_source_receipt_peer_instance_id_source_id_pk": { - "name": "federation_source_receipt_peer_instance_id_source_id_pk", - "columns": [ - "peer_instance_id", - "source_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.on_demand_fetch": { - "name": "on_demand_fetch", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "retry_at": { - "name": "retry_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "claimed_until": { - "name": "claimed_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "on_demand_fetch_source_id_cell_pk": { - "name": "on_demand_fetch_source_id_cell_pk", - "columns": [ - "source_id", - "cell" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "on_demand_fetch_status_enum": { - "name": "on_demand_fetch_status_enum", - "value": "\"conditions\".\"on_demand_fetch\".\"status\" IN ('pending','fresh','failed')" - } - }, - "isRLSEnabled": false - }, - "conditions.on_demand_quota": { - "name": "on_demand_quota", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "tokens": { - "name": "tokens", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "refilled_at": { - "name": "refilled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "day": { - "name": "day", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "day_count": { - "name": "day_count", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "product": { - "name": "product", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "restricted": { - "name": "restricted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restricted_since": { - "name": "restricted_since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fusion_restricted": { - "name": "fusion_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "fusion_tier": { - "name": "fusion_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "fusion_licenses": { - "name": "fusion_licenses", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "federation_restricted": { - "name": "federation_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "federation_pending": { - "name": "federation_pending", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0064_snapshot.json b/packages/core/drizzle/meta/0064_snapshot.json deleted file mode 100644 index 5e140bb52..000000000 --- a/packages/core/drizzle/meta/0064_snapshot.json +++ /dev/null @@ -1,5541 +0,0 @@ -{ - "id": "78d4d1be-3a27-4353-8b9c-344543169ade", - "prevId": "461c1d1c-ac45-4203-93f9-4472bc6ae093", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "reading": { - "name": "reading", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template_hash": { - "name": "template_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "crowd_record_id": { - "name": "crowd_record_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_sources": { - "name": "fused_sources", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_public": { - "name": "fused_public", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_source": { - "name": "idx_observation_latest_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "series_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_effective_brin": { - "name": "idx_observation_latest_effective_brin", - "columns": [ - { - "expression": "effective_from", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "brin", - "with": {} - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "crowd_record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"crowd_record_id\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "nullsNotDistinct": false, - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ] - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "tableTo": "offer", - "schemaTo": "conditions", - "columnsFrom": [ - "offer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_erasure": { - "name": "archive_erasure", - "schema": "conditions", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "applied_at": { - "name": "applied_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_source_receipt": { - "name": "federation_source_receipt", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_received_at": { - "name": "last_received_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_source_receipt_peer_instance_id_source_id_pk": { - "name": "federation_source_receipt_peer_instance_id_source_id_pk", - "columns": [ - "peer_instance_id", - "source_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.on_demand_fetch": { - "name": "on_demand_fetch", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "retry_at": { - "name": "retry_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "claimed_until": { - "name": "claimed_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "on_demand_fetch_source_id_cell_pk": { - "name": "on_demand_fetch_source_id_cell_pk", - "columns": [ - "source_id", - "cell" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "on_demand_fetch_status_enum": { - "name": "on_demand_fetch_status_enum", - "value": "\"conditions\".\"on_demand_fetch\".\"status\" IN ('pending','fresh','failed')" - } - }, - "isRLSEnabled": false - }, - "conditions.on_demand_quota": { - "name": "on_demand_quota", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "tokens": { - "name": "tokens", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "refilled_at": { - "name": "refilled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "day": { - "name": "day", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "day_count": { - "name": "day_count", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "product": { - "name": "product", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "restricted": { - "name": "restricted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restricted_since": { - "name": "restricted_since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fusion_restricted": { - "name": "fusion_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "fusion_tier": { - "name": "fusion_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "fusion_licenses": { - "name": "fusion_licenses", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "federation_restricted": { - "name": "federation_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "federation_pending": { - "name": "federation_pending", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0065_snapshot.json b/packages/core/drizzle/meta/0065_snapshot.json deleted file mode 100644 index f5c961db0..000000000 --- a/packages/core/drizzle/meta/0065_snapshot.json +++ /dev/null @@ -1,5543 +0,0 @@ -{ - "id": "19776d9b-f300-40e4-9fe4-4460323c7798", - "prevId": "78d4d1be-3a27-4353-8b9c-344543169ade", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "reading": { - "name": "reading", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template_hash": { - "name": "template_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "crowd_record_id": { - "name": "crowd_record_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_sources": { - "name": "fused_sources", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_public": { - "name": "fused_public", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_source": { - "name": "idx_observation_latest_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "series_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_effective_brin": { - "name": "idx_observation_latest_effective_brin", - "columns": [ - { - "expression": "effective_from", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "brin", - "with": {} - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "crowd_record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"crowd_record_id\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "nullsNotDistinct": false, - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ] - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "tableTo": "offer", - "schemaTo": "conditions", - "columnsFrom": [ - "offer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_erasure": { - "name": "archive_erasure", - "schema": "conditions", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "applied_at": { - "name": "applied_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_source_receipt": { - "name": "federation_source_receipt", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_received_at": { - "name": "last_received_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_source_receipt_peer_instance_id_source_id_pk": { - "name": "federation_source_receipt_peer_instance_id_source_id_pk", - "columns": [ - "peer_instance_id", - "source_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.on_demand_fetch": { - "name": "on_demand_fetch", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "retry_at": { - "name": "retry_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "claimed_until": { - "name": "claimed_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "on_demand_fetch_source_id_cell_pk": { - "name": "on_demand_fetch_source_id_cell_pk", - "columns": [ - "source_id", - "cell" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "on_demand_fetch_status_enum": { - "name": "on_demand_fetch_status_enum", - "value": "\"conditions\".\"on_demand_fetch\".\"status\" IN ('pending','fresh','failed')" - } - }, - "isRLSEnabled": false - }, - "conditions.on_demand_quota": { - "name": "on_demand_quota", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "tokens": { - "name": "tokens", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "refilled_at": { - "name": "refilled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "day": { - "name": "day", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "day_count": { - "name": "day_count", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "product": { - "name": "product", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "restricted": { - "name": "restricted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restricted_since": { - "name": "restricted_since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fusion_restricted": { - "name": "fusion_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "fusion_tier": { - "name": "fusion_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "fusion_licenses": { - "name": "fusion_licenses", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "federation_restricted": { - "name": "federation_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "federation_pending": { - "name": "federation_pending", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0066_snapshot.json b/packages/core/drizzle/meta/0066_snapshot.json deleted file mode 100644 index 2adbb8118..000000000 --- a/packages/core/drizzle/meta/0066_snapshot.json +++ /dev/null @@ -1,5545 +0,0 @@ -{ - "id": "9a7b09c9-90ad-4cb4-9b4b-0e3df7d5396e", - "prevId": "19776d9b-f300-40e4-9fe4-4460323c7798", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "reading": { - "name": "reading", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template_hash": { - "name": "template_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "crowd_record_id": { - "name": "crowd_record_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_sources": { - "name": "fused_sources", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_public": { - "name": "fused_public", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_source": { - "name": "idx_observation_latest_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "series_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_effective_brin": { - "name": "idx_observation_latest_effective_brin", - "columns": [ - { - "expression": "effective_from", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "brin", - "with": {} - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "crowd_record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"crowd_record_id\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "nullsNotDistinct": false, - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ] - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "tableTo": "offer", - "schemaTo": "conditions", - "columnsFrom": [ - "offer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_erasure": { - "name": "archive_erasure", - "schema": "conditions", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "applied_at": { - "name": "applied_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_source_receipt": { - "name": "federation_source_receipt", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_received_at": { - "name": "last_received_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_source_receipt_peer_instance_id_source_id_pk": { - "name": "federation_source_receipt_peer_instance_id_source_id_pk", - "columns": [ - "peer_instance_id", - "source_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.on_demand_fetch": { - "name": "on_demand_fetch", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "retry_at": { - "name": "retry_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "claimed_until": { - "name": "claimed_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "on_demand_fetch_source_id_cell_pk": { - "name": "on_demand_fetch_source_id_cell_pk", - "columns": [ - "source_id", - "cell" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "on_demand_fetch_status_enum": { - "name": "on_demand_fetch_status_enum", - "value": "\"conditions\".\"on_demand_fetch\".\"status\" IN ('pending','fresh','failed')" - } - }, - "isRLSEnabled": false - }, - "conditions.on_demand_quota": { - "name": "on_demand_quota", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "tokens": { - "name": "tokens", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "refilled_at": { - "name": "refilled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "day": { - "name": "day", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "day_count": { - "name": "day_count", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "product": { - "name": "product", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "restricted": { - "name": "restricted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restricted_since": { - "name": "restricted_since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fusion_restricted": { - "name": "fusion_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "fusion_tier": { - "name": "fusion_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "fusion_licenses": { - "name": "fusion_licenses", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "federation_restricted": { - "name": "federation_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "federation_pending": { - "name": "federation_pending", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0067_snapshot.json b/packages/core/drizzle/meta/0067_snapshot.json deleted file mode 100644 index b2c66fb68..000000000 --- a/packages/core/drizzle/meta/0067_snapshot.json +++ /dev/null @@ -1,5545 +0,0 @@ -{ - "id": "fbad79fb-3941-4ea2-a9b5-0c5a8feb0b17", - "prevId": "9a7b09c9-90ad-4cb4-9b4b-0e3df7d5396e", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "reading": { - "name": "reading", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template_hash": { - "name": "template_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "crowd_record_id": { - "name": "crowd_record_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_sources": { - "name": "fused_sources", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_public": { - "name": "fused_public", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_source": { - "name": "idx_observation_latest_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "series_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_effective_brin": { - "name": "idx_observation_latest_effective_brin", - "columns": [ - { - "expression": "effective_from", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "brin", - "with": {} - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "crowd_record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"crowd_record_id\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "nullsNotDistinct": false, - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ] - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\" COLLATE \"C\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "tableTo": "offer", - "schemaTo": "conditions", - "columnsFrom": [ - "offer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_erasure": { - "name": "archive_erasure", - "schema": "conditions", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "applied_at": { - "name": "applied_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_source_receipt": { - "name": "federation_source_receipt", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_received_at": { - "name": "last_received_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_source_receipt_peer_instance_id_source_id_pk": { - "name": "federation_source_receipt_peer_instance_id_source_id_pk", - "columns": [ - "peer_instance_id", - "source_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.on_demand_fetch": { - "name": "on_demand_fetch", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "retry_at": { - "name": "retry_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "claimed_until": { - "name": "claimed_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "on_demand_fetch_source_id_cell_pk": { - "name": "on_demand_fetch_source_id_cell_pk", - "columns": [ - "source_id", - "cell" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "on_demand_fetch_status_enum": { - "name": "on_demand_fetch_status_enum", - "value": "\"conditions\".\"on_demand_fetch\".\"status\" IN ('pending','fresh','failed')" - } - }, - "isRLSEnabled": false - }, - "conditions.on_demand_quota": { - "name": "on_demand_quota", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "tokens": { - "name": "tokens", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "refilled_at": { - "name": "refilled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "day": { - "name": "day", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "day_count": { - "name": "day_count", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "product": { - "name": "product", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "restricted": { - "name": "restricted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restricted_since": { - "name": "restricted_since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fusion_restricted": { - "name": "fusion_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "fusion_tier": { - "name": "fusion_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "fusion_licenses": { - "name": "fusion_licenses", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "federation_restricted": { - "name": "federation_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "federation_pending": { - "name": "federation_pending", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0068_snapshot.json b/packages/core/drizzle/meta/0068_snapshot.json deleted file mode 100644 index c4235e4e6..000000000 --- a/packages/core/drizzle/meta/0068_snapshot.json +++ /dev/null @@ -1,5655 +0,0 @@ -{ - "id": "17bdca86-efe3-4ea6-aee7-ecd89b8076ae", - "prevId": "fbad79fb-3941-4ea2-a9b5-0c5a8feb0b17", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.contributor_receipt": { - "name": "contributor_receipt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "version": { - "name": "version", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "contributors": { - "name": "contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "reading": { - "name": "reading", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template_hash": { - "name": "template_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_id": { - "name": "contributor_receipt_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "crowd_record_id": { - "name": "crowd_record_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_sources": { - "name": "fused_sources", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_public": { - "name": "fused_public", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_source": { - "name": "idx_observation_latest_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "series_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_effective_brin": { - "name": "idx_observation_latest_effective_brin", - "columns": [ - { - "expression": "effective_from", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "brin", - "with": {} - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "crowd_record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"crowd_record_id\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "nullsNotDistinct": false, - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ] - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\" COLLATE \"C\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "tableTo": "offer", - "schemaTo": "conditions", - "columnsFrom": [ - "offer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_erasure": { - "name": "archive_erasure", - "schema": "conditions", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "applied_at": { - "name": "applied_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_source_receipt": { - "name": "federation_source_receipt", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_received_at": { - "name": "last_received_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_source_receipt_peer_instance_id_source_id_pk": { - "name": "federation_source_receipt_peer_instance_id_source_id_pk", - "columns": [ - "peer_instance_id", - "source_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.on_demand_fetch": { - "name": "on_demand_fetch", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "retry_at": { - "name": "retry_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "claimed_until": { - "name": "claimed_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "on_demand_fetch_source_id_cell_pk": { - "name": "on_demand_fetch_source_id_cell_pk", - "columns": [ - "source_id", - "cell" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "on_demand_fetch_status_enum": { - "name": "on_demand_fetch_status_enum", - "value": "\"conditions\".\"on_demand_fetch\".\"status\" IN ('pending','fresh','failed')" - } - }, - "isRLSEnabled": false - }, - "conditions.on_demand_quota": { - "name": "on_demand_quota", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "tokens": { - "name": "tokens", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "refilled_at": { - "name": "refilled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "day": { - "name": "day", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "day_count": { - "name": "day_count", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "product": { - "name": "product", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "credit_name": { - "name": "credit_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_url": { - "name": "credit_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_notice": { - "name": "credit_notice", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "restricted": { - "name": "restricted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restricted_since": { - "name": "restricted_since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fusion_restricted": { - "name": "fusion_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "fusion_tier": { - "name": "fusion_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "fusion_licenses": { - "name": "fusion_licenses", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "federation_restricted": { - "name": "federation_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "federation_pending": { - "name": "federation_pending", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0069_snapshot.json b/packages/core/drizzle/meta/0069_snapshot.json deleted file mode 100644 index 5c4fd7432..000000000 --- a/packages/core/drizzle/meta/0069_snapshot.json +++ /dev/null @@ -1,5655 +0,0 @@ -{ - "id": "04898cc3-384a-40fd-a5ea-68fe00aa662e", - "prevId": "17bdca86-efe3-4ea6-aee7-ecd89b8076ae", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "isExpression": true, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.contributor_receipt": { - "name": "contributor_receipt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "version": { - "name": "version", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "contributors": { - "name": "contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "reading": { - "name": "reading", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template_hash": { - "name": "template_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_id": { - "name": "contributor_receipt_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "crowd_record_id": { - "name": "crowd_record_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_sources": { - "name": "fused_sources", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_public": { - "name": "fused_public", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_observation_latest_source": { - "name": "idx_observation_latest_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "series_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false - }, - "idx_observation_latest_effective_brin": { - "name": "idx_observation_latest_effective_brin", - "columns": [ - { - "expression": "effective_from", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "brin", - "concurrently": false - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "crowd_record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"observation_latest\".\"crowd_record_id\" IS NOT NULL", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "columnsFrom": [ - "series_id" - ], - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsTo": [ - "series_id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "columnsFrom": [ - "series_id" - ], - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsTo": [ - "series_id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "isExpression": true, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": { - "fastupdate": "off" - }, - "method": "gin", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": { - "fastupdate": "off" - }, - "method": "gin", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "gin", - "concurrently": false - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "columnsFrom": [ - "feature_id" - ], - "tableTo": "feature", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\" COLLATE \"C\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "columnsFrom": [ - "feature_id" - ], - "tableTo": "feature", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "columnsFrom": [ - "offer_id" - ], - "tableTo": "offer", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "columnsFrom": [ - "situation_id" - ], - "tableTo": "situation", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "columnsFrom": [ - "situation_id" - ], - "tableTo": "situation", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_erasure": { - "name": "archive_erasure", - "schema": "conditions", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "applied_at": { - "name": "applied_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_source_receipt": { - "name": "federation_source_receipt", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_received_at": { - "name": "last_received_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_source_receipt_peer_instance_id_source_id_pk": { - "name": "federation_source_receipt_peer_instance_id_source_id_pk", - "columns": [ - "peer_instance_id", - "source_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.on_demand_fetch": { - "name": "on_demand_fetch", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "retry_at": { - "name": "retry_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "claimed_until": { - "name": "claimed_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "on_demand_fetch_source_id_cell_pk": { - "name": "on_demand_fetch_source_id_cell_pk", - "columns": [ - "source_id", - "cell" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "on_demand_fetch_status_enum": { - "name": "on_demand_fetch_status_enum", - "value": "\"conditions\".\"on_demand_fetch\".\"status\" IN ('pending','fresh','failed')" - } - }, - "isRLSEnabled": false - }, - "conditions.on_demand_quota": { - "name": "on_demand_quota", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "tokens": { - "name": "tokens", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "refilled_at": { - "name": "refilled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "day": { - "name": "day", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "day_count": { - "name": "day_count", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "product": { - "name": "product", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "credit_name": { - "name": "credit_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_url": { - "name": "credit_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_notice": { - "name": "credit_notice", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "restricted": { - "name": "restricted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restricted_since": { - "name": "restricted_since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fusion_restricted": { - "name": "fusion_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "fusion_tier": { - "name": "fusion_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "fusion_licenses": { - "name": "fusion_licenses", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "federation_restricted": { - "name": "federation_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "federation_pending": { - "name": "federation_pending", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "views": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0070_snapshot.json b/packages/core/drizzle/meta/0070_snapshot.json deleted file mode 100644 index 7b632c5e3..000000000 --- a/packages/core/drizzle/meta/0070_snapshot.json +++ /dev/null @@ -1,5729 +0,0 @@ -{ - "id": "12a0ad10-b163-4d06-b349-284144a4f90f", - "prevId": "04898cc3-384a-40fd-a5ea-68fe00aa662e", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.report_refusal": { - "name": "report_refusal", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_report_refusal_actor": { - "name": "idx_report_refusal_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_refusal_occurred": { - "name": "idx_report_refusal_occurred", - "columns": [ - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.contributor_receipt": { - "name": "contributor_receipt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "version": { - "name": "version", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "contributors": { - "name": "contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "reading": { - "name": "reading", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template_hash": { - "name": "template_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_id": { - "name": "contributor_receipt_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "crowd_record_id": { - "name": "crowd_record_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_sources": { - "name": "fused_sources", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_public": { - "name": "fused_public", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_source": { - "name": "idx_observation_latest_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "series_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_effective_brin": { - "name": "idx_observation_latest_effective_brin", - "columns": [ - { - "expression": "effective_from", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "brin", - "with": {} - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "crowd_record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"crowd_record_id\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "nullsNotDistinct": false, - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ] - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\" COLLATE \"C\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "tableTo": "offer", - "schemaTo": "conditions", - "columnsFrom": [ - "offer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_erasure": { - "name": "archive_erasure", - "schema": "conditions", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "applied_at": { - "name": "applied_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_source_receipt": { - "name": "federation_source_receipt", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_received_at": { - "name": "last_received_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_source_receipt_peer_instance_id_source_id_pk": { - "name": "federation_source_receipt_peer_instance_id_source_id_pk", - "columns": [ - "peer_instance_id", - "source_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.on_demand_fetch": { - "name": "on_demand_fetch", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "retry_at": { - "name": "retry_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "claimed_until": { - "name": "claimed_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "on_demand_fetch_source_id_cell_pk": { - "name": "on_demand_fetch_source_id_cell_pk", - "columns": [ - "source_id", - "cell" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "on_demand_fetch_status_enum": { - "name": "on_demand_fetch_status_enum", - "value": "\"conditions\".\"on_demand_fetch\".\"status\" IN ('pending','fresh','failed')" - } - }, - "isRLSEnabled": false - }, - "conditions.on_demand_quota": { - "name": "on_demand_quota", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "tokens": { - "name": "tokens", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "refilled_at": { - "name": "refilled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "day": { - "name": "day", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "day_count": { - "name": "day_count", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "product": { - "name": "product", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "credit_name": { - "name": "credit_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_url": { - "name": "credit_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_notice": { - "name": "credit_notice", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "restricted": { - "name": "restricted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restricted_since": { - "name": "restricted_since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fusion_restricted": { - "name": "fusion_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "fusion_tier": { - "name": "fusion_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "fusion_licenses": { - "name": "fusion_licenses", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "federation_restricted": { - "name": "federation_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "federation_pending": { - "name": "federation_pending", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0071_snapshot.json b/packages/core/drizzle/meta/0071_snapshot.json deleted file mode 100644 index 438b70029..000000000 --- a/packages/core/drizzle/meta/0071_snapshot.json +++ /dev/null @@ -1,5777 +0,0 @@ -{ - "id": "e971edc9-e0e6-4a57-9df1-d680175cf7af", - "prevId": "12a0ad10-b163-4d06-b349-284144a4f90f", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.report_refusal": { - "name": "report_refusal", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_report_refusal_actor": { - "name": "idx_report_refusal_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_refusal_occurred": { - "name": "idx_report_refusal_occurred", - "columns": [ - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.contributor_receipt": { - "name": "contributor_receipt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "version": { - "name": "version", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "contributors": { - "name": "contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "reading": { - "name": "reading", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template_hash": { - "name": "template_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_id": { - "name": "contributor_receipt_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "crowd_record_id": { - "name": "crowd_record_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_sources": { - "name": "fused_sources", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_public": { - "name": "fused_public", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_source": { - "name": "idx_observation_latest_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "series_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_effective_brin": { - "name": "idx_observation_latest_effective_brin", - "columns": [ - { - "expression": "effective_from", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "brin", - "with": {} - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "crowd_record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"crowd_record_id\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "nullsNotDistinct": false, - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ] - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - }, - "idx_feature_rights_revoked": { - "name": "idx_feature_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"feature\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\" COLLATE \"C\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_rights_revoked": { - "name": "idx_offer_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"offer\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "tableTo": "offer", - "schemaTo": "conditions", - "columnsFrom": [ - "offer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_rights_revoked": { - "name": "idx_situation_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_erasure": { - "name": "archive_erasure", - "schema": "conditions", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "applied_at": { - "name": "applied_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_source_receipt": { - "name": "federation_source_receipt", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_received_at": { - "name": "last_received_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_source_receipt_peer_instance_id_source_id_pk": { - "name": "federation_source_receipt_peer_instance_id_source_id_pk", - "columns": [ - "peer_instance_id", - "source_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.on_demand_fetch": { - "name": "on_demand_fetch", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "retry_at": { - "name": "retry_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "claimed_until": { - "name": "claimed_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "on_demand_fetch_source_id_cell_pk": { - "name": "on_demand_fetch_source_id_cell_pk", - "columns": [ - "source_id", - "cell" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "on_demand_fetch_status_enum": { - "name": "on_demand_fetch_status_enum", - "value": "\"conditions\".\"on_demand_fetch\".\"status\" IN ('pending','fresh','failed')" - } - }, - "isRLSEnabled": false - }, - "conditions.on_demand_quota": { - "name": "on_demand_quota", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "tokens": { - "name": "tokens", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "refilled_at": { - "name": "refilled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "day": { - "name": "day", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "day_count": { - "name": "day_count", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "product": { - "name": "product", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "credit_name": { - "name": "credit_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_url": { - "name": "credit_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_notice": { - "name": "credit_notice", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "restricted": { - "name": "restricted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restricted_since": { - "name": "restricted_since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fusion_restricted": { - "name": "fusion_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "fusion_tier": { - "name": "fusion_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "fusion_licenses": { - "name": "fusion_licenses", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "federation_restricted": { - "name": "federation_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "federation_pending": { - "name": "federation_pending", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0072_snapshot.json b/packages/core/drizzle/meta/0072_snapshot.json deleted file mode 100644 index 2049de5ce..000000000 --- a/packages/core/drizzle/meta/0072_snapshot.json +++ /dev/null @@ -1,5777 +0,0 @@ -{ - "id": "093e7b90-d618-4611-bc77-04909cb33af9", - "prevId": "e971edc9-e0e6-4a57-9df1-d680175cf7af", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "isExpression": true, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.report_refusal": { - "name": "report_refusal", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_report_refusal_actor": { - "name": "idx_report_refusal_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_report_refusal_occurred": { - "name": "idx_report_refusal_occurred", - "columns": [ - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.contributor_receipt": { - "name": "contributor_receipt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "version": { - "name": "version", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "contributors": { - "name": "contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "reading": { - "name": "reading", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template_hash": { - "name": "template_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_id": { - "name": "contributor_receipt_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "crowd_record_id": { - "name": "crowd_record_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_sources": { - "name": "fused_sources", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_public": { - "name": "fused_public", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_observation_latest_source": { - "name": "idx_observation_latest_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "series_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false - }, - "idx_observation_latest_effective_brin": { - "name": "idx_observation_latest_effective_brin", - "columns": [ - { - "expression": "effective_from", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "brin", - "concurrently": false - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "crowd_record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"observation_latest\".\"crowd_record_id\" IS NOT NULL", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "columnsFrom": [ - "series_id" - ], - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsTo": [ - "series_id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "columnsFrom": [ - "series_id" - ], - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsTo": [ - "series_id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "isExpression": true, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": { - "fastupdate": "off" - }, - "method": "gin", - "concurrently": false - }, - "idx_feature_rights_revoked": { - "name": "idx_feature_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"feature\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": { - "fastupdate": "off" - }, - "method": "gin", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "gin", - "concurrently": false - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "columnsFrom": [ - "feature_id" - ], - "tableTo": "feature", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\" COLLATE \"C\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "columnsFrom": [ - "feature_id" - ], - "tableTo": "feature", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_rights_revoked": { - "name": "idx_offer_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"offer\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "columnsFrom": [ - "offer_id" - ], - "tableTo": "offer", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false - }, - "idx_situation_rights_revoked": { - "name": "idx_situation_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"situation\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "columnsFrom": [ - "situation_id" - ], - "tableTo": "situation", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "columnsFrom": [ - "situation_id" - ], - "tableTo": "situation", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_erasure": { - "name": "archive_erasure", - "schema": "conditions", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "applied_at": { - "name": "applied_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_source_receipt": { - "name": "federation_source_receipt", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_received_at": { - "name": "last_received_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_source_receipt_peer_instance_id_source_id_pk": { - "name": "federation_source_receipt_peer_instance_id_source_id_pk", - "columns": [ - "peer_instance_id", - "source_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.on_demand_fetch": { - "name": "on_demand_fetch", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "retry_at": { - "name": "retry_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "claimed_until": { - "name": "claimed_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "on_demand_fetch_source_id_cell_pk": { - "name": "on_demand_fetch_source_id_cell_pk", - "columns": [ - "source_id", - "cell" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "on_demand_fetch_status_enum": { - "name": "on_demand_fetch_status_enum", - "value": "\"conditions\".\"on_demand_fetch\".\"status\" IN ('pending','fresh','failed')" - } - }, - "isRLSEnabled": false - }, - "conditions.on_demand_quota": { - "name": "on_demand_quota", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "tokens": { - "name": "tokens", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "refilled_at": { - "name": "refilled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "day": { - "name": "day", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "day_count": { - "name": "day_count", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "product": { - "name": "product", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "credit_name": { - "name": "credit_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_url": { - "name": "credit_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_notice": { - "name": "credit_notice", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "restricted": { - "name": "restricted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restricted_since": { - "name": "restricted_since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fusion_restricted": { - "name": "fusion_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "fusion_tier": { - "name": "fusion_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "fusion_licenses": { - "name": "fusion_licenses", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "federation_restricted": { - "name": "federation_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "federation_pending": { - "name": "federation_pending", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "views": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0073_snapshot.json b/packages/core/drizzle/meta/0073_snapshot.json deleted file mode 100644 index e8b3dfde7..000000000 --- a/packages/core/drizzle/meta/0073_snapshot.json +++ /dev/null @@ -1,5777 +0,0 @@ -{ - "id": "c8077a38-22e4-482b-8bd8-6e6e54d34dc4", - "prevId": "093e7b90-d618-4611-bc77-04909cb33af9", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.report_refusal": { - "name": "report_refusal", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_report_refusal_actor": { - "name": "idx_report_refusal_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_refusal_occurred": { - "name": "idx_report_refusal_occurred", - "columns": [ - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.contributor_receipt": { - "name": "contributor_receipt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "version": { - "name": "version", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "contributors": { - "name": "contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "reading": { - "name": "reading", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template_hash": { - "name": "template_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_id": { - "name": "contributor_receipt_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "crowd_record_id": { - "name": "crowd_record_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_sources": { - "name": "fused_sources", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_public": { - "name": "fused_public", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_source": { - "name": "idx_observation_latest_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "series_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_effective_brin": { - "name": "idx_observation_latest_effective_brin", - "columns": [ - { - "expression": "effective_from", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "brin", - "with": {} - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "crowd_record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"crowd_record_id\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "nullsNotDistinct": false, - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ] - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - }, - "idx_feature_rights_revoked": { - "name": "idx_feature_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"feature\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\" COLLATE \"C\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_rights_revoked": { - "name": "idx_offer_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"offer\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "tableTo": "offer", - "schemaTo": "conditions", - "columnsFrom": [ - "offer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_rights_revoked": { - "name": "idx_situation_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_erasure": { - "name": "archive_erasure", - "schema": "conditions", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "applied_at": { - "name": "applied_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete','liveness')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_source_receipt": { - "name": "federation_source_receipt", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_received_at": { - "name": "last_received_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_source_receipt_peer_instance_id_source_id_pk": { - "name": "federation_source_receipt_peer_instance_id_source_id_pk", - "columns": [ - "peer_instance_id", - "source_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.on_demand_fetch": { - "name": "on_demand_fetch", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "retry_at": { - "name": "retry_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "claimed_until": { - "name": "claimed_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "on_demand_fetch_source_id_cell_pk": { - "name": "on_demand_fetch_source_id_cell_pk", - "columns": [ - "source_id", - "cell" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "on_demand_fetch_status_enum": { - "name": "on_demand_fetch_status_enum", - "value": "\"conditions\".\"on_demand_fetch\".\"status\" IN ('pending','fresh','failed')" - } - }, - "isRLSEnabled": false - }, - "conditions.on_demand_quota": { - "name": "on_demand_quota", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "tokens": { - "name": "tokens", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "refilled_at": { - "name": "refilled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "day": { - "name": "day", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "day_count": { - "name": "day_count", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "product": { - "name": "product", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "credit_name": { - "name": "credit_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_url": { - "name": "credit_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_notice": { - "name": "credit_notice", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "restricted": { - "name": "restricted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restricted_since": { - "name": "restricted_since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fusion_restricted": { - "name": "fusion_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "fusion_tier": { - "name": "fusion_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "fusion_licenses": { - "name": "fusion_licenses", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "federation_restricted": { - "name": "federation_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "federation_pending": { - "name": "federation_pending", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0074_snapshot.json b/packages/core/drizzle/meta/0074_snapshot.json deleted file mode 100644 index 11fc03398..000000000 --- a/packages/core/drizzle/meta/0074_snapshot.json +++ /dev/null @@ -1,5839 +0,0 @@ -{ - "id": "fb37a12b-c3c1-4c3f-b76e-b9b16cbdcf61", - "prevId": "c8077a38-22e4-482b-8bd8-6e6e54d34dc4", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.report_refusal": { - "name": "report_refusal", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_report_refusal_actor": { - "name": "idx_report_refusal_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_refusal_occurred": { - "name": "idx_report_refusal_occurred", - "columns": [ - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.contributor_receipt": { - "name": "contributor_receipt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "version": { - "name": "version", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "contributors": { - "name": "contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "reading": { - "name": "reading", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template_hash": { - "name": "template_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_id": { - "name": "contributor_receipt_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "crowd_record_id": { - "name": "crowd_record_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_sources": { - "name": "fused_sources", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_public": { - "name": "fused_public", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_source": { - "name": "idx_observation_latest_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "series_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_effective_brin": { - "name": "idx_observation_latest_effective_brin", - "columns": [ - { - "expression": "effective_from", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "brin", - "with": {} - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "crowd_record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"crowd_record_id\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "nullsNotDistinct": false, - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ] - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - }, - "idx_feature_rights_revoked": { - "name": "idx_feature_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"feature\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\" COLLATE \"C\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_rights_revoked": { - "name": "idx_offer_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"offer\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "tableTo": "offer", - "schemaTo": "conditions", - "columnsFrom": [ - "offer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_rights_revoked": { - "name": "idx_situation_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_erasure": { - "name": "archive_erasure", - "schema": "conditions", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "applied_at": { - "name": "applied_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete','liveness')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_source_receipt": { - "name": "federation_source_receipt", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_received_at": { - "name": "last_received_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_source_receipt_peer_instance_id_source_id_pk": { - "name": "federation_source_receipt_peer_instance_id_source_id_pk", - "columns": [ - "peer_instance_id", - "source_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.on_demand_fetch": { - "name": "on_demand_fetch", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "retry_at": { - "name": "retry_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "claimed_until": { - "name": "claimed_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "on_demand_fetch_source_id_cell_pk": { - "name": "on_demand_fetch_source_id_cell_pk", - "columns": [ - "source_id", - "cell" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "on_demand_fetch_status_enum": { - "name": "on_demand_fetch_status_enum", - "value": "\"conditions\".\"on_demand_fetch\".\"status\" IN ('pending','fresh','failed')" - } - }, - "isRLSEnabled": false - }, - "conditions.on_demand_quota": { - "name": "on_demand_quota", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "tokens": { - "name": "tokens", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "refilled_at": { - "name": "refilled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "day": { - "name": "day", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "day_count": { - "name": "day_count", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_shrink": { - "name": "source_shrink", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "since": { - "name": "since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "polls": { - "name": "polls", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "stated": { - "name": "stated", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "held": { - "name": "held", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "source_shrink_source_id_scope_pk": { - "name": "source_shrink_source_id_scope_pk", - "columns": [ - "source_id", - "scope" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_shrink_scope_enum": { - "name": "source_shrink_scope_enum", - "value": "\"conditions\".\"source_shrink\".\"scope\" IN ('series','records')" - } - }, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "product": { - "name": "product", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "credit_name": { - "name": "credit_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_url": { - "name": "credit_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_notice": { - "name": "credit_notice", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "restricted": { - "name": "restricted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restricted_since": { - "name": "restricted_since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fusion_restricted": { - "name": "fusion_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "fusion_tier": { - "name": "fusion_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "fusion_licenses": { - "name": "fusion_licenses", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "federation_restricted": { - "name": "federation_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "federation_pending": { - "name": "federation_pending", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0075_snapshot.json b/packages/core/drizzle/meta/0075_snapshot.json deleted file mode 100644 index 45b2faace..000000000 --- a/packages/core/drizzle/meta/0075_snapshot.json +++ /dev/null @@ -1,5871 +0,0 @@ -{ - "id": "9b11ffb0-8e36-4495-bfc0-fd39e6727577", - "prevId": "fb37a12b-c3c1-4c3f-b76e-b9b16cbdcf61", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.report_refusal": { - "name": "report_refusal", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_report_refusal_actor": { - "name": "idx_report_refusal_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_refusal_occurred": { - "name": "idx_report_refusal_occurred", - "columns": [ - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.contributor_receipt": { - "name": "contributor_receipt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "version": { - "name": "version", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "contributors": { - "name": "contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "reading": { - "name": "reading", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template_hash": { - "name": "template_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_id": { - "name": "contributor_receipt_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "crowd_record_id": { - "name": "crowd_record_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_sources": { - "name": "fused_sources", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_public": { - "name": "fused_public", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_source": { - "name": "idx_observation_latest_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "series_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_effective_brin": { - "name": "idx_observation_latest_effective_brin", - "columns": [ - { - "expression": "effective_from", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "brin", - "with": {} - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "crowd_record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"crowd_record_id\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "nullsNotDistinct": false, - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ] - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - }, - "idx_feature_rights_revoked": { - "name": "idx_feature_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"feature\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\" COLLATE \"C\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_rights_revoked": { - "name": "idx_offer_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"offer\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "tableTo": "offer", - "schemaTo": "conditions", - "columnsFrom": [ - "offer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_rights_revoked": { - "name": "idx_situation_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_erasure": { - "name": "archive_erasure", - "schema": "conditions", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "applied_at": { - "name": "applied_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete','liveness')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_cursor": { - "name": "federation_peer_cursor", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_source_receipt": { - "name": "federation_source_receipt", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_received_at": { - "name": "last_received_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_source_receipt_peer_instance_id_source_id_pk": { - "name": "federation_source_receipt_peer_instance_id_source_id_pk", - "columns": [ - "peer_instance_id", - "source_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.on_demand_fetch": { - "name": "on_demand_fetch", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "retry_at": { - "name": "retry_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "claimed_until": { - "name": "claimed_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "on_demand_fetch_source_id_cell_pk": { - "name": "on_demand_fetch_source_id_cell_pk", - "columns": [ - "source_id", - "cell" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "on_demand_fetch_status_enum": { - "name": "on_demand_fetch_status_enum", - "value": "\"conditions\".\"on_demand_fetch\".\"status\" IN ('pending','fresh','failed')" - } - }, - "isRLSEnabled": false - }, - "conditions.on_demand_quota": { - "name": "on_demand_quota", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "tokens": { - "name": "tokens", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "refilled_at": { - "name": "refilled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "day": { - "name": "day", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "day_count": { - "name": "day_count", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_shrink": { - "name": "source_shrink", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "since": { - "name": "since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "polls": { - "name": "polls", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "stated": { - "name": "stated", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "held": { - "name": "held", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "source_shrink_source_id_scope_pk": { - "name": "source_shrink_source_id_scope_pk", - "columns": [ - "source_id", - "scope" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_shrink_scope_enum": { - "name": "source_shrink_scope_enum", - "value": "\"conditions\".\"source_shrink\".\"scope\" IN ('series','records')" - } - }, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "product": { - "name": "product", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "credit_name": { - "name": "credit_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_url": { - "name": "credit_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_notice": { - "name": "credit_notice", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "restricted": { - "name": "restricted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restricted_since": { - "name": "restricted_since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fusion_restricted": { - "name": "fusion_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "fusion_tier": { - "name": "fusion_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "fusion_licenses": { - "name": "fusion_licenses", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "federation_restricted": { - "name": "federation_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "federation_pending": { - "name": "federation_pending", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0076_snapshot.json b/packages/core/drizzle/meta/0076_snapshot.json deleted file mode 100644 index 39ab97af4..000000000 --- a/packages/core/drizzle/meta/0076_snapshot.json +++ /dev/null @@ -1,5956 +0,0 @@ -{ - "id": "bfbca207-6ca0-40e4-bcb2-c1e7ccce3c08", - "prevId": "9b11ffb0-8e36-4495-bfc0-fd39e6727577", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.report_refusal": { - "name": "report_refusal", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_report_refusal_actor": { - "name": "idx_report_refusal_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_refusal_occurred": { - "name": "idx_report_refusal_occurred", - "columns": [ - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.contributor_receipt": { - "name": "contributor_receipt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "version": { - "name": "version", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "contributors": { - "name": "contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "reading": { - "name": "reading", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template_hash": { - "name": "template_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_id": { - "name": "contributor_receipt_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "crowd_record_id": { - "name": "crowd_record_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_sources": { - "name": "fused_sources", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_public": { - "name": "fused_public", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_source": { - "name": "idx_observation_latest_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "series_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_effective_brin": { - "name": "idx_observation_latest_effective_brin", - "columns": [ - { - "expression": "effective_from", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "brin", - "with": {} - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "crowd_record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"crowd_record_id\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "nullsNotDistinct": false, - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ] - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - }, - "idx_feature_rights_revoked": { - "name": "idx_feature_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"feature\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\" COLLATE \"C\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_rights_revoked": { - "name": "idx_offer_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"offer\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "tableTo": "offer", - "schemaTo": "conditions", - "columnsFrom": [ - "offer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_rights_revoked": { - "name": "idx_situation_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_erasure": { - "name": "archive_erasure", - "schema": "conditions", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "applied_at": { - "name": "applied_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_lapsed_copy": { - "name": "federation_lapsed_copy", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "lapsed_at": { - "name": "lapsed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_lapsed_copy_source": { - "name": "idx_federation_lapsed_copy_source", - "columns": [ - { - "expression": "peer_instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_lapsed_copy_record_class_record_id_pk": { - "name": "federation_lapsed_copy_record_class_record_id_pk", - "columns": [ - "record_class", - "record_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete','liveness')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_cursor": { - "name": "federation_peer_cursor", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_source_receipt": { - "name": "federation_source_receipt", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_received_at": { - "name": "last_received_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "liveness_at": { - "name": "liveness_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_source_receipt_peer_instance_id_source_id_pk": { - "name": "federation_source_receipt_peer_instance_id_source_id_pk", - "columns": [ - "peer_instance_id", - "source_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.on_demand_fetch": { - "name": "on_demand_fetch", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "retry_at": { - "name": "retry_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "claimed_until": { - "name": "claimed_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "on_demand_fetch_source_id_cell_pk": { - "name": "on_demand_fetch_source_id_cell_pk", - "columns": [ - "source_id", - "cell" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "on_demand_fetch_status_enum": { - "name": "on_demand_fetch_status_enum", - "value": "\"conditions\".\"on_demand_fetch\".\"status\" IN ('pending','fresh','failed')" - } - }, - "isRLSEnabled": false - }, - "conditions.on_demand_quota": { - "name": "on_demand_quota", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "tokens": { - "name": "tokens", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "refilled_at": { - "name": "refilled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "day": { - "name": "day", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "day_count": { - "name": "day_count", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_shrink": { - "name": "source_shrink", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "since": { - "name": "since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "polls": { - "name": "polls", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "stated": { - "name": "stated", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "held": { - "name": "held", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "source_shrink_source_id_scope_pk": { - "name": "source_shrink_source_id_scope_pk", - "columns": [ - "source_id", - "scope" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_shrink_scope_enum": { - "name": "source_shrink_scope_enum", - "value": "\"conditions\".\"source_shrink\".\"scope\" IN ('series','records')" - } - }, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "product": { - "name": "product", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "credit_name": { - "name": "credit_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_url": { - "name": "credit_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_notice": { - "name": "credit_notice", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "restricted": { - "name": "restricted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restricted_since": { - "name": "restricted_since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fusion_restricted": { - "name": "fusion_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "fusion_tier": { - "name": "fusion_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "fusion_licenses": { - "name": "fusion_licenses", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "federation_restricted": { - "name": "federation_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "federation_pending": { - "name": "federation_pending", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0077_snapshot.json b/packages/core/drizzle/meta/0077_snapshot.json deleted file mode 100644 index c92c8d97c..000000000 --- a/packages/core/drizzle/meta/0077_snapshot.json +++ /dev/null @@ -1,6063 +0,0 @@ -{ - "id": "65fef115-6229-4b61-b853-d22f559de5ea", - "prevId": "bfbca207-6ca0-40e4-bcb2-c1e7ccce3c08", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.report_refusal": { - "name": "report_refusal", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_report_refusal_actor": { - "name": "idx_report_refusal_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_refusal_occurred": { - "name": "idx_report_refusal_occurred", - "columns": [ - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.contributor_receipt": { - "name": "contributor_receipt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "version": { - "name": "version", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "contributors": { - "name": "contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "provenance": { - "name": "provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "reading": { - "name": "reading", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template_hash": { - "name": "template_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_id": { - "name": "contributor_receipt_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "crowd_record_id": { - "name": "crowd_record_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_sources": { - "name": "fused_sources", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_public": { - "name": "fused_public", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_source": { - "name": "idx_observation_latest_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "series_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_effective_brin": { - "name": "idx_observation_latest_effective_brin", - "columns": [ - { - "expression": "effective_from", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "brin", - "with": {} - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "crowd_record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"crowd_record_id\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "nullsNotDistinct": false, - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ] - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - }, - "idx_feature_rights_revoked": { - "name": "idx_feature_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"feature\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\" COLLATE \"C\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_rights_revoked": { - "name": "idx_offer_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"offer\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "tableTo": "offer", - "schemaTo": "conditions", - "columnsFrom": [ - "offer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_rights_revoked": { - "name": "idx_situation_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_erasure": { - "name": "archive_erasure", - "schema": "conditions", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "applied_at": { - "name": "applied_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_lapsed_copy": { - "name": "federation_lapsed_copy", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "lapsed_at": { - "name": "lapsed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_lapsed_copy_source": { - "name": "idx_federation_lapsed_copy_source", - "columns": [ - { - "expression": "peer_instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_lapsed_copy_record_class_record_id_pk": { - "name": "federation_lapsed_copy_record_class_record_id_pk", - "columns": [ - "record_class", - "record_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete','liveness')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_cursor": { - "name": "federation_peer_cursor", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_source_receipt": { - "name": "federation_source_receipt", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_received_at": { - "name": "last_received_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "liveness_at": { - "name": "liveness_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_source_receipt_peer_instance_id_source_id_pk": { - "name": "federation_source_receipt_peer_instance_id_source_id_pk", - "columns": [ - "peer_instance_id", - "source_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.on_demand_fetch": { - "name": "on_demand_fetch", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "retry_at": { - "name": "retry_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "claimed_until": { - "name": "claimed_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "on_demand_fetch_source_id_cell_pk": { - "name": "on_demand_fetch_source_id_cell_pk", - "columns": [ - "source_id", - "cell" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "on_demand_fetch_status_enum": { - "name": "on_demand_fetch_status_enum", - "value": "\"conditions\".\"on_demand_fetch\".\"status\" IN ('pending','fresh','failed')" - } - }, - "isRLSEnabled": false - }, - "conditions.on_demand_quota": { - "name": "on_demand_quota", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "tokens": { - "name": "tokens", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "refilled_at": { - "name": "refilled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "day": { - "name": "day", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "day_count": { - "name": "day_count", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.public_license_policy": { - "name": "public_license_policy", - "schema": "conditions", - "columns": { - "license": { - "name": "license", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_shrink": { - "name": "source_shrink", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "since": { - "name": "since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "polls": { - "name": "polls", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "stated": { - "name": "stated", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "held": { - "name": "held", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "source_shrink_source_id_scope_pk": { - "name": "source_shrink_source_id_scope_pk", - "columns": [ - "source_id", - "scope" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_shrink_scope_enum": { - "name": "source_shrink_scope_enum", - "value": "\"conditions\".\"source_shrink\".\"scope\" IN ('series','records')" - } - }, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "product": { - "name": "product", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "credit_name": { - "name": "credit_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_url": { - "name": "credit_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_notice": { - "name": "credit_notice", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "restricted": { - "name": "restricted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restricted_since": { - "name": "restricted_since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fusion_restricted": { - "name": "fusion_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "fusion_tier": { - "name": "fusion_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "fusion_licenses": { - "name": "fusion_licenses", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "federation_restricted": { - "name": "federation_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "federation_pending": { - "name": "federation_pending", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0078_snapshot.json b/packages/core/drizzle/meta/0078_snapshot.json deleted file mode 100644 index 869bd21c0..000000000 --- a/packages/core/drizzle/meta/0078_snapshot.json +++ /dev/null @@ -1,6063 +0,0 @@ -{ - "id": "2d30dc8b-a6f9-4fb4-8403-8e248f2a6c74", - "prevId": "65fef115-6229-4b61-b853-d22f559de5ea", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "isExpression": true, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.report_refusal": { - "name": "report_refusal", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_report_refusal_actor": { - "name": "idx_report_refusal_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_report_refusal_occurred": { - "name": "idx_report_refusal_occurred", - "columns": [ - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.contributor_receipt": { - "name": "contributor_receipt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "version": { - "name": "version", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "contributors": { - "name": "contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "provenance": { - "name": "provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "reading": { - "name": "reading", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template_hash": { - "name": "template_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_id": { - "name": "contributor_receipt_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "crowd_record_id": { - "name": "crowd_record_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_sources": { - "name": "fused_sources", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_public": { - "name": "fused_public", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_observation_latest_source": { - "name": "idx_observation_latest_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "series_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false - }, - "idx_observation_latest_effective_brin": { - "name": "idx_observation_latest_effective_brin", - "columns": [ - { - "expression": "effective_from", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "brin", - "concurrently": false - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "crowd_record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"observation_latest\".\"crowd_record_id\" IS NOT NULL", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "columnsFrom": [ - "series_id" - ], - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsTo": [ - "series_id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "columnsFrom": [ - "series_id" - ], - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsTo": [ - "series_id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "isExpression": true, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": { - "fastupdate": "off" - }, - "method": "gin", - "concurrently": false - }, - "idx_feature_rights_revoked": { - "name": "idx_feature_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"feature\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": { - "fastupdate": "off" - }, - "method": "gin", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "gin", - "concurrently": false - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "columnsFrom": [ - "feature_id" - ], - "tableTo": "feature", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\" COLLATE \"C\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "columnsFrom": [ - "feature_id" - ], - "tableTo": "feature", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_rights_revoked": { - "name": "idx_offer_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"offer\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "columnsFrom": [ - "offer_id" - ], - "tableTo": "offer", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false - }, - "idx_situation_rights_revoked": { - "name": "idx_situation_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"situation\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "columnsFrom": [ - "situation_id" - ], - "tableTo": "situation", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "columnsFrom": [ - "situation_id" - ], - "tableTo": "situation", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_erasure": { - "name": "archive_erasure", - "schema": "conditions", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "applied_at": { - "name": "applied_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_lapsed_copy": { - "name": "federation_lapsed_copy", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "lapsed_at": { - "name": "lapsed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_lapsed_copy_source": { - "name": "idx_federation_lapsed_copy_source", - "columns": [ - { - "expression": "peer_instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_lapsed_copy_record_class_record_id_pk": { - "name": "federation_lapsed_copy_record_class_record_id_pk", - "columns": [ - "record_class", - "record_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete','liveness')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_cursor": { - "name": "federation_peer_cursor", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_source_receipt": { - "name": "federation_source_receipt", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_received_at": { - "name": "last_received_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "liveness_at": { - "name": "liveness_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_source_receipt_peer_instance_id_source_id_pk": { - "name": "federation_source_receipt_peer_instance_id_source_id_pk", - "columns": [ - "peer_instance_id", - "source_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.on_demand_fetch": { - "name": "on_demand_fetch", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "retry_at": { - "name": "retry_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "claimed_until": { - "name": "claimed_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "on_demand_fetch_source_id_cell_pk": { - "name": "on_demand_fetch_source_id_cell_pk", - "columns": [ - "source_id", - "cell" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "on_demand_fetch_status_enum": { - "name": "on_demand_fetch_status_enum", - "value": "\"conditions\".\"on_demand_fetch\".\"status\" IN ('pending','fresh','failed')" - } - }, - "isRLSEnabled": false - }, - "conditions.on_demand_quota": { - "name": "on_demand_quota", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "tokens": { - "name": "tokens", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "refilled_at": { - "name": "refilled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "day": { - "name": "day", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "day_count": { - "name": "day_count", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.public_license_policy": { - "name": "public_license_policy", - "schema": "conditions", - "columns": { - "license": { - "name": "license", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_shrink": { - "name": "source_shrink", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "since": { - "name": "since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "polls": { - "name": "polls", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "stated": { - "name": "stated", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "held": { - "name": "held", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "source_shrink_source_id_scope_pk": { - "name": "source_shrink_source_id_scope_pk", - "columns": [ - "source_id", - "scope" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_shrink_scope_enum": { - "name": "source_shrink_scope_enum", - "value": "\"conditions\".\"source_shrink\".\"scope\" IN ('series','records')" - } - }, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "product": { - "name": "product", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "credit_name": { - "name": "credit_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_url": { - "name": "credit_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_notice": { - "name": "credit_notice", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "restricted": { - "name": "restricted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restricted_since": { - "name": "restricted_since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fusion_restricted": { - "name": "fusion_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "fusion_tier": { - "name": "fusion_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "fusion_licenses": { - "name": "fusion_licenses", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "federation_restricted": { - "name": "federation_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "federation_pending": { - "name": "federation_pending", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "views": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0079_snapshot.json b/packages/core/drizzle/meta/0079_snapshot.json deleted file mode 100644 index 1300adb38..000000000 --- a/packages/core/drizzle/meta/0079_snapshot.json +++ /dev/null @@ -1,6131 +0,0 @@ -{ - "id": "2ab57822-306c-407c-8fbd-b8b0ef8827a8", - "prevId": "2d30dc8b-a6f9-4fb4-8403-8e248f2a6c74", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.report_refusal": { - "name": "report_refusal", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_report_refusal_actor": { - "name": "idx_report_refusal_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_refusal_occurred": { - "name": "idx_report_refusal_occurred", - "columns": [ - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.contributor_receipt": { - "name": "contributor_receipt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "version": { - "name": "version", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "contributors": { - "name": "contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "provenance": { - "name": "provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "reading": { - "name": "reading", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template_hash": { - "name": "template_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_id": { - "name": "contributor_receipt_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "crowd_record_id": { - "name": "crowd_record_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_sources": { - "name": "fused_sources", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_public": { - "name": "fused_public", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_source": { - "name": "idx_observation_latest_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "series_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_effective_brin": { - "name": "idx_observation_latest_effective_brin", - "columns": [ - { - "expression": "effective_from", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "brin", - "with": {} - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "crowd_record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"crowd_record_id\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "nullsNotDistinct": false, - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ] - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - }, - "idx_feature_rights_revoked": { - "name": "idx_feature_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"feature\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\" COLLATE \"C\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_rights_revoked": { - "name": "idx_offer_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"offer\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "tableTo": "offer", - "schemaTo": "conditions", - "columnsFrom": [ - "offer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_rights_revoked": { - "name": "idx_situation_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_erasure": { - "name": "archive_erasure", - "schema": "conditions", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "applied_at": { - "name": "applied_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_lapsed_copy": { - "name": "federation_lapsed_copy", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "lapsed_at": { - "name": "lapsed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_lapsed_copy_source": { - "name": "idx_federation_lapsed_copy_source", - "columns": [ - { - "expression": "peer_instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_lapsed_copy_record_class_record_id_pk": { - "name": "federation_lapsed_copy_record_class_record_id_pk", - "columns": [ - "record_class", - "record_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete','liveness')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_cursor": { - "name": "federation_peer_cursor", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_source_receipt": { - "name": "federation_source_receipt", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_received_at": { - "name": "last_received_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "liveness_at": { - "name": "liveness_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_source_receipt_peer_instance_id_source_id_pk": { - "name": "federation_source_receipt_peer_instance_id_source_id_pk", - "columns": [ - "peer_instance_id", - "source_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.on_demand_fetch": { - "name": "on_demand_fetch", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "retry_at": { - "name": "retry_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "claimed_until": { - "name": "claimed_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "on_demand_fetch_source_id_cell_pk": { - "name": "on_demand_fetch_source_id_cell_pk", - "columns": [ - "source_id", - "cell" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "on_demand_fetch_status_enum": { - "name": "on_demand_fetch_status_enum", - "value": "\"conditions\".\"on_demand_fetch\".\"status\" IN ('pending','fresh','failed')" - } - }, - "isRLSEnabled": false - }, - "conditions.on_demand_quota": { - "name": "on_demand_quota", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "tokens": { - "name": "tokens", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "refilled_at": { - "name": "refilled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "day": { - "name": "day", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "day_count": { - "name": "day_count", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.public_license_policy": { - "name": "public_license_policy", - "schema": "conditions", - "columns": { - "license": { - "name": "license", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_shrink": { - "name": "source_shrink", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "since": { - "name": "since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "polls": { - "name": "polls", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "stated": { - "name": "stated", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "held": { - "name": "held", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "source_shrink_source_id_scope_pk": { - "name": "source_shrink_source_id_scope_pk", - "columns": [ - "source_id", - "scope" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_shrink_scope_enum": { - "name": "source_shrink_scope_enum", - "value": "\"conditions\".\"source_shrink\".\"scope\" IN ('series','records')" - } - }, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.oauth_grant": { - "name": "oauth_grant", - "schema": "conditions", - "columns": { - "grant_key": { - "name": "grant_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_issued_at": { - "name": "refresh_issued_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_expires_at": { - "name": "access_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "rejected_at": { - "name": "rejected_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "product": { - "name": "product", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "credit_name": { - "name": "credit_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_url": { - "name": "credit_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_notice": { - "name": "credit_notice", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "restricted": { - "name": "restricted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restricted_since": { - "name": "restricted_since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fusion_restricted": { - "name": "fusion_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "fusion_tier": { - "name": "fusion_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "fusion_licenses": { - "name": "fusion_licenses", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "federation_restricted": { - "name": "federation_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "federation_pending": { - "name": "federation_pending", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0080_snapshot.json b/packages/core/drizzle/meta/0080_snapshot.json deleted file mode 100644 index 33393c404..000000000 --- a/packages/core/drizzle/meta/0080_snapshot.json +++ /dev/null @@ -1,6131 +0,0 @@ -{ - "id": "66d62d71-e7e2-41aa-a576-c0b13eb04ab8", - "prevId": "2ab57822-306c-407c-8fbd-b8b0ef8827a8", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.report_refusal": { - "name": "report_refusal", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_report_refusal_actor": { - "name": "idx_report_refusal_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_refusal_occurred": { - "name": "idx_report_refusal_occurred", - "columns": [ - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.contributor_receipt": { - "name": "contributor_receipt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "version": { - "name": "version", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "contributors": { - "name": "contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "provenance": { - "name": "provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "reading": { - "name": "reading", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template_hash": { - "name": "template_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_id": { - "name": "contributor_receipt_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "crowd_record_id": { - "name": "crowd_record_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_sources": { - "name": "fused_sources", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_public": { - "name": "fused_public", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_source": { - "name": "idx_observation_latest_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "series_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_effective_brin": { - "name": "idx_observation_latest_effective_brin", - "columns": [ - { - "expression": "effective_from", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "brin", - "with": {} - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "crowd_record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"crowd_record_id\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "nullsNotDistinct": false, - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ] - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - }, - "idx_feature_rights_revoked": { - "name": "idx_feature_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"feature\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\" COLLATE \"C\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_rights_revoked": { - "name": "idx_offer_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"offer\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "tableTo": "offer", - "schemaTo": "conditions", - "columnsFrom": [ - "offer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_rights_revoked": { - "name": "idx_situation_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('none', 'minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_erasure": { - "name": "archive_erasure", - "schema": "conditions", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "applied_at": { - "name": "applied_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_lapsed_copy": { - "name": "federation_lapsed_copy", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "lapsed_at": { - "name": "lapsed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_lapsed_copy_source": { - "name": "idx_federation_lapsed_copy_source", - "columns": [ - { - "expression": "peer_instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_lapsed_copy_record_class_record_id_pk": { - "name": "federation_lapsed_copy_record_class_record_id_pk", - "columns": [ - "record_class", - "record_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete','liveness')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_cursor": { - "name": "federation_peer_cursor", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_source_receipt": { - "name": "federation_source_receipt", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_received_at": { - "name": "last_received_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "liveness_at": { - "name": "liveness_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_source_receipt_peer_instance_id_source_id_pk": { - "name": "federation_source_receipt_peer_instance_id_source_id_pk", - "columns": [ - "peer_instance_id", - "source_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.on_demand_fetch": { - "name": "on_demand_fetch", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "retry_at": { - "name": "retry_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "claimed_until": { - "name": "claimed_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "on_demand_fetch_source_id_cell_pk": { - "name": "on_demand_fetch_source_id_cell_pk", - "columns": [ - "source_id", - "cell" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "on_demand_fetch_status_enum": { - "name": "on_demand_fetch_status_enum", - "value": "\"conditions\".\"on_demand_fetch\".\"status\" IN ('pending','fresh','failed')" - } - }, - "isRLSEnabled": false - }, - "conditions.on_demand_quota": { - "name": "on_demand_quota", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "tokens": { - "name": "tokens", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "refilled_at": { - "name": "refilled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "day": { - "name": "day", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "day_count": { - "name": "day_count", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.public_license_policy": { - "name": "public_license_policy", - "schema": "conditions", - "columns": { - "license": { - "name": "license", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_shrink": { - "name": "source_shrink", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "since": { - "name": "since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "polls": { - "name": "polls", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "stated": { - "name": "stated", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "held": { - "name": "held", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "source_shrink_source_id_scope_pk": { - "name": "source_shrink_source_id_scope_pk", - "columns": [ - "source_id", - "scope" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_shrink_scope_enum": { - "name": "source_shrink_scope_enum", - "value": "\"conditions\".\"source_shrink\".\"scope\" IN ('series','records')" - } - }, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.oauth_grant": { - "name": "oauth_grant", - "schema": "conditions", - "columns": { - "grant_key": { - "name": "grant_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_issued_at": { - "name": "refresh_issued_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_expires_at": { - "name": "access_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "rejected_at": { - "name": "rejected_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "product": { - "name": "product", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "credit_name": { - "name": "credit_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_url": { - "name": "credit_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_notice": { - "name": "credit_notice", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "restricted": { - "name": "restricted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restricted_since": { - "name": "restricted_since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fusion_restricted": { - "name": "fusion_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "fusion_tier": { - "name": "fusion_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "fusion_licenses": { - "name": "fusion_licenses", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "federation_restricted": { - "name": "federation_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "federation_pending": { - "name": "federation_pending", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0081_snapshot.json b/packages/core/drizzle/meta/0081_snapshot.json deleted file mode 100644 index b0cd4eebb..000000000 --- a/packages/core/drizzle/meta/0081_snapshot.json +++ /dev/null @@ -1,6182 +0,0 @@ -{ - "id": "44b20bf6-b5c8-4169-9f20-0c6ee33fd5bb", - "prevId": "66d62d71-e7e2-41aa-a576-c0b13eb04ab8", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.report_refusal": { - "name": "report_refusal", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_report_refusal_actor": { - "name": "idx_report_refusal_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_refusal_occurred": { - "name": "idx_report_refusal_occurred", - "columns": [ - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.contributor_receipt": { - "name": "contributor_receipt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "version": { - "name": "version", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "contributors": { - "name": "contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "provenance": { - "name": "provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "reading": { - "name": "reading", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template_hash": { - "name": "template_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_id": { - "name": "contributor_receipt_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "crowd_record_id": { - "name": "crowd_record_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_sources": { - "name": "fused_sources", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_public": { - "name": "fused_public", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_source": { - "name": "idx_observation_latest_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "series_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_effective_brin": { - "name": "idx_observation_latest_effective_brin", - "columns": [ - { - "expression": "effective_from", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "brin", - "with": {} - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "crowd_record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"crowd_record_id\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "nullsNotDistinct": false, - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ] - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - }, - "idx_feature_rights_revoked": { - "name": "idx_feature_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"feature\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\" COLLATE \"C\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_rights_revoked": { - "name": "idx_offer_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"offer\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "tableTo": "offer", - "schemaTo": "conditions", - "columnsFrom": [ - "offer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_rights_revoked": { - "name": "idx_situation_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('none', 'minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_erasure": { - "name": "archive_erasure", - "schema": "conditions", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "applied_at": { - "name": "applied_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "endorsed_by": { - "name": "endorsed_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "endorsement": { - "name": "endorsement", - "type": "bytea", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_lapsed_copy": { - "name": "federation_lapsed_copy", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "lapsed_at": { - "name": "lapsed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_lapsed_copy_source": { - "name": "idx_federation_lapsed_copy_source", - "columns": [ - { - "expression": "peer_instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_lapsed_copy_record_class_record_id_pk": { - "name": "federation_lapsed_copy_record_class_record_id_pk", - "columns": [ - "record_class", - "record_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete','liveness')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_cursor": { - "name": "federation_peer_cursor", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_key": { - "name": "federation_peer_key", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "learned_at": { - "name": "learned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_peer_key_peer_instance_id_key_id_pk": { - "name": "federation_peer_key_peer_instance_id_key_id_pk", - "columns": [ - "peer_instance_id", - "key_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_source_receipt": { - "name": "federation_source_receipt", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_received_at": { - "name": "last_received_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "liveness_at": { - "name": "liveness_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_source_receipt_peer_instance_id_source_id_pk": { - "name": "federation_source_receipt_peer_instance_id_source_id_pk", - "columns": [ - "peer_instance_id", - "source_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.on_demand_fetch": { - "name": "on_demand_fetch", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "retry_at": { - "name": "retry_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "claimed_until": { - "name": "claimed_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "on_demand_fetch_source_id_cell_pk": { - "name": "on_demand_fetch_source_id_cell_pk", - "columns": [ - "source_id", - "cell" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "on_demand_fetch_status_enum": { - "name": "on_demand_fetch_status_enum", - "value": "\"conditions\".\"on_demand_fetch\".\"status\" IN ('pending','fresh','failed')" - } - }, - "isRLSEnabled": false - }, - "conditions.on_demand_quota": { - "name": "on_demand_quota", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "tokens": { - "name": "tokens", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "refilled_at": { - "name": "refilled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "day": { - "name": "day", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "day_count": { - "name": "day_count", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.public_license_policy": { - "name": "public_license_policy", - "schema": "conditions", - "columns": { - "license": { - "name": "license", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_shrink": { - "name": "source_shrink", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "since": { - "name": "since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "polls": { - "name": "polls", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "stated": { - "name": "stated", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "held": { - "name": "held", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "source_shrink_source_id_scope_pk": { - "name": "source_shrink_source_id_scope_pk", - "columns": [ - "source_id", - "scope" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_shrink_scope_enum": { - "name": "source_shrink_scope_enum", - "value": "\"conditions\".\"source_shrink\".\"scope\" IN ('series','records')" - } - }, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.oauth_grant": { - "name": "oauth_grant", - "schema": "conditions", - "columns": { - "grant_key": { - "name": "grant_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_issued_at": { - "name": "refresh_issued_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_expires_at": { - "name": "access_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "rejected_at": { - "name": "rejected_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "product": { - "name": "product", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "credit_name": { - "name": "credit_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_url": { - "name": "credit_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_notice": { - "name": "credit_notice", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "restricted": { - "name": "restricted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restricted_since": { - "name": "restricted_since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fusion_restricted": { - "name": "fusion_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "fusion_tier": { - "name": "fusion_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "fusion_licenses": { - "name": "fusion_licenses", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "federation_restricted": { - "name": "federation_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "federation_pending": { - "name": "federation_pending", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0082_snapshot.json b/packages/core/drizzle/meta/0082_snapshot.json deleted file mode 100644 index 42cb9be9d..000000000 --- a/packages/core/drizzle/meta/0082_snapshot.json +++ /dev/null @@ -1,6210 +0,0 @@ -{ - "id": "6c4815b4-6747-4f65-9099-de3750182d98", - "prevId": "44b20bf6-b5c8-4169-9f20-0c6ee33fd5bb", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.report_refusal": { - "name": "report_refusal", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_report_refusal_actor": { - "name": "idx_report_refusal_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_refusal_occurred": { - "name": "idx_report_refusal_occurred", - "columns": [ - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.contributor_receipt": { - "name": "contributor_receipt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "version": { - "name": "version", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "contributors": { - "name": "contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "provenance": { - "name": "provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "reading": { - "name": "reading", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template_hash": { - "name": "template_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_id": { - "name": "contributor_receipt_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "crowd_record_id": { - "name": "crowd_record_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_sources": { - "name": "fused_sources", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_public": { - "name": "fused_public", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_source": { - "name": "idx_observation_latest_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "series_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_effective_brin": { - "name": "idx_observation_latest_effective_brin", - "columns": [ - { - "expression": "effective_from", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "brin", - "with": {} - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "crowd_record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"crowd_record_id\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "nullsNotDistinct": false, - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ] - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - }, - "idx_feature_rights_revoked": { - "name": "idx_feature_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"feature\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\" COLLATE \"C\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_rights_revoked": { - "name": "idx_offer_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"offer\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "tableTo": "offer", - "schemaTo": "conditions", - "columnsFrom": [ - "offer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_rights_revoked": { - "name": "idx_situation_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('none', 'minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_erasure": { - "name": "archive_erasure", - "schema": "conditions", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "applied_at": { - "name": "applied_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "endorsed_by": { - "name": "endorsed_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "endorsement": { - "name": "endorsement", - "type": "bytea", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_lapsed_copy": { - "name": "federation_lapsed_copy", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "lapsed_at": { - "name": "lapsed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_lapsed_copy_source": { - "name": "idx_federation_lapsed_copy_source", - "columns": [ - { - "expression": "peer_instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_lapsed_copy_record_class_record_id_pk": { - "name": "federation_lapsed_copy_record_class_record_id_pk", - "columns": [ - "record_class", - "record_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete','liveness')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_cursor": { - "name": "federation_peer_cursor", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_key": { - "name": "federation_peer_key", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "learned_at": { - "name": "learned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_peer_key_peer_instance_id_key_id_pk": { - "name": "federation_peer_key_peer_instance_id_key_id_pk", - "columns": [ - "peer_instance_id", - "key_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_source_receipt": { - "name": "federation_source_receipt", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_received_at": { - "name": "last_received_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "liveness_at": { - "name": "liveness_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_source_receipt_peer_instance_id_source_id_pk": { - "name": "federation_source_receipt_peer_instance_id_source_id_pk", - "columns": [ - "peer_instance_id", - "source_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "uq_federation_subscription_target": { - "name": "uq_federation_subscription_target", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "delivery_mode", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "coalesce(\"inbox_url\", '')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"conditions\".\"federation_subscription\".\"delivery_mode\" <> 'sse'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.on_demand_fetch": { - "name": "on_demand_fetch", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "retry_at": { - "name": "retry_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "claimed_until": { - "name": "claimed_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "on_demand_fetch_source_id_cell_pk": { - "name": "on_demand_fetch_source_id_cell_pk", - "columns": [ - "source_id", - "cell" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "on_demand_fetch_status_enum": { - "name": "on_demand_fetch_status_enum", - "value": "\"conditions\".\"on_demand_fetch\".\"status\" IN ('pending','fresh','failed')" - } - }, - "isRLSEnabled": false - }, - "conditions.on_demand_quota": { - "name": "on_demand_quota", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "tokens": { - "name": "tokens", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "refilled_at": { - "name": "refilled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "day": { - "name": "day", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "day_count": { - "name": "day_count", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.public_license_policy": { - "name": "public_license_policy", - "schema": "conditions", - "columns": { - "license": { - "name": "license", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_shrink": { - "name": "source_shrink", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "since": { - "name": "since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "polls": { - "name": "polls", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "stated": { - "name": "stated", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "held": { - "name": "held", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "source_shrink_source_id_scope_pk": { - "name": "source_shrink_source_id_scope_pk", - "columns": [ - "source_id", - "scope" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_shrink_scope_enum": { - "name": "source_shrink_scope_enum", - "value": "\"conditions\".\"source_shrink\".\"scope\" IN ('series','records')" - } - }, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.oauth_grant": { - "name": "oauth_grant", - "schema": "conditions", - "columns": { - "grant_key": { - "name": "grant_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_issued_at": { - "name": "refresh_issued_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_expires_at": { - "name": "access_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "rejected_at": { - "name": "rejected_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "product": { - "name": "product", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "credit_name": { - "name": "credit_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_url": { - "name": "credit_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_notice": { - "name": "credit_notice", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "restricted": { - "name": "restricted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restricted_since": { - "name": "restricted_since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fusion_restricted": { - "name": "fusion_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "fusion_tier": { - "name": "fusion_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "fusion_licenses": { - "name": "fusion_licenses", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "federation_restricted": { - "name": "federation_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "federation_pending": { - "name": "federation_pending", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0083_snapshot.json b/packages/core/drizzle/meta/0083_snapshot.json deleted file mode 100644 index 1d3f44a50..000000000 --- a/packages/core/drizzle/meta/0083_snapshot.json +++ /dev/null @@ -1,6222 +0,0 @@ -{ - "id": "4a9de75b-b69d-4b68-a666-e9a4d26bf199", - "prevId": "6c4815b4-6747-4f65-9099-de3750182d98", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.report_refusal": { - "name": "report_refusal", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_report_refusal_actor": { - "name": "idx_report_refusal_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_refusal_occurred": { - "name": "idx_report_refusal_occurred", - "columns": [ - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.contributor_receipt": { - "name": "contributor_receipt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "version": { - "name": "version", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "contributors": { - "name": "contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "provenance": { - "name": "provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "reading": { - "name": "reading", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template_hash": { - "name": "template_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_id": { - "name": "contributor_receipt_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "crowd_record_id": { - "name": "crowd_record_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_sources": { - "name": "fused_sources", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_public": { - "name": "fused_public", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_source": { - "name": "idx_observation_latest_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "series_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_effective_brin": { - "name": "idx_observation_latest_effective_brin", - "columns": [ - { - "expression": "effective_from", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "brin", - "with": {} - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "crowd_record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"crowd_record_id\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "nullsNotDistinct": false, - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ] - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - }, - "idx_feature_rights_revoked": { - "name": "idx_feature_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"feature\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\" COLLATE \"C\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_rights_revoked": { - "name": "idx_offer_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"offer\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "tableTo": "offer", - "schemaTo": "conditions", - "columnsFrom": [ - "offer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_rights_revoked": { - "name": "idx_situation_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('none', 'minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_erasure": { - "name": "archive_erasure", - "schema": "conditions", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "applied_at": { - "name": "applied_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "endorsed_by": { - "name": "endorsed_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "endorsement": { - "name": "endorsement", - "type": "bytea", - "primaryKey": false, - "notNull": false - }, - "endorsement_proof": { - "name": "endorsement_proof", - "type": "bytea", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_lapsed_copy": { - "name": "federation_lapsed_copy", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "lapsed_at": { - "name": "lapsed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_lapsed_copy_source": { - "name": "idx_federation_lapsed_copy_source", - "columns": [ - { - "expression": "peer_instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_lapsed_copy_record_class_record_id_pk": { - "name": "federation_lapsed_copy_record_class_record_id_pk", - "columns": [ - "record_class", - "record_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete','liveness')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_cursor": { - "name": "federation_peer_cursor", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_key": { - "name": "federation_peer_key", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "anchor": { - "name": "anchor", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "learned_at": { - "name": "learned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_peer_key_peer_instance_id_key_id_pk": { - "name": "federation_peer_key_peer_instance_id_key_id_pk", - "columns": [ - "peer_instance_id", - "key_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_source_receipt": { - "name": "federation_source_receipt", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_received_at": { - "name": "last_received_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "liveness_at": { - "name": "liveness_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_source_receipt_peer_instance_id_source_id_pk": { - "name": "federation_source_receipt_peer_instance_id_source_id_pk", - "columns": [ - "peer_instance_id", - "source_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "uq_federation_subscription_target": { - "name": "uq_federation_subscription_target", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "delivery_mode", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "coalesce(\"inbox_url\", '')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"conditions\".\"federation_subscription\".\"delivery_mode\" <> 'sse'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.on_demand_fetch": { - "name": "on_demand_fetch", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "retry_at": { - "name": "retry_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "claimed_until": { - "name": "claimed_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "on_demand_fetch_source_id_cell_pk": { - "name": "on_demand_fetch_source_id_cell_pk", - "columns": [ - "source_id", - "cell" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "on_demand_fetch_status_enum": { - "name": "on_demand_fetch_status_enum", - "value": "\"conditions\".\"on_demand_fetch\".\"status\" IN ('pending','fresh','failed')" - } - }, - "isRLSEnabled": false - }, - "conditions.on_demand_quota": { - "name": "on_demand_quota", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "tokens": { - "name": "tokens", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "refilled_at": { - "name": "refilled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "day": { - "name": "day", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "day_count": { - "name": "day_count", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.public_license_policy": { - "name": "public_license_policy", - "schema": "conditions", - "columns": { - "license": { - "name": "license", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_shrink": { - "name": "source_shrink", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "since": { - "name": "since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "polls": { - "name": "polls", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "stated": { - "name": "stated", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "held": { - "name": "held", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "source_shrink_source_id_scope_pk": { - "name": "source_shrink_source_id_scope_pk", - "columns": [ - "source_id", - "scope" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_shrink_scope_enum": { - "name": "source_shrink_scope_enum", - "value": "\"conditions\".\"source_shrink\".\"scope\" IN ('series','records')" - } - }, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.oauth_grant": { - "name": "oauth_grant", - "schema": "conditions", - "columns": { - "grant_key": { - "name": "grant_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_issued_at": { - "name": "refresh_issued_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_expires_at": { - "name": "access_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "rejected_at": { - "name": "rejected_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "product": { - "name": "product", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "credit_name": { - "name": "credit_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_url": { - "name": "credit_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_notice": { - "name": "credit_notice", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "restricted": { - "name": "restricted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restricted_since": { - "name": "restricted_since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fusion_restricted": { - "name": "fusion_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "fusion_tier": { - "name": "fusion_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "fusion_licenses": { - "name": "fusion_licenses", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "federation_restricted": { - "name": "federation_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "federation_pending": { - "name": "federation_pending", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0084_snapshot.json b/packages/core/drizzle/meta/0084_snapshot.json deleted file mode 100644 index 3d032574a..000000000 --- a/packages/core/drizzle/meta/0084_snapshot.json +++ /dev/null @@ -1,6228 +0,0 @@ -{ - "id": "8b9c769c-43e7-45e1-82e8-73057f14af55", - "prevId": "4a9de75b-b69d-4b68-a666-e9a4d26bf199", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.report_refusal": { - "name": "report_refusal", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_report_refusal_actor": { - "name": "idx_report_refusal_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_refusal_occurred": { - "name": "idx_report_refusal_occurred", - "columns": [ - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.contributor_receipt": { - "name": "contributor_receipt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "version": { - "name": "version", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "contributors": { - "name": "contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "provenance": { - "name": "provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "reading": { - "name": "reading", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template_hash": { - "name": "template_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_id": { - "name": "contributor_receipt_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "crowd_record_id": { - "name": "crowd_record_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_sources": { - "name": "fused_sources", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_public": { - "name": "fused_public", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_source": { - "name": "idx_observation_latest_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "series_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_effective_brin": { - "name": "idx_observation_latest_effective_brin", - "columns": [ - { - "expression": "effective_from", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "brin", - "with": {} - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "crowd_record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"crowd_record_id\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "nullsNotDistinct": false, - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ] - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - }, - "idx_feature_rights_revoked": { - "name": "idx_feature_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"feature\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\" COLLATE \"C\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_rights_revoked": { - "name": "idx_offer_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"offer\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "tableTo": "offer", - "schemaTo": "conditions", - "columnsFrom": [ - "offer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_rights_revoked": { - "name": "idx_situation_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('none', 'minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_erasure": { - "name": "archive_erasure", - "schema": "conditions", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "applied_at": { - "name": "applied_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "endorsed_by": { - "name": "endorsed_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "endorsement": { - "name": "endorsement", - "type": "bytea", - "primaryKey": false, - "notNull": false - }, - "endorsement_proof": { - "name": "endorsement_proof", - "type": "bytea", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_lapsed_copy": { - "name": "federation_lapsed_copy", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "lapsed_at": { - "name": "lapsed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_lapsed_copy_source": { - "name": "idx_federation_lapsed_copy_source", - "columns": [ - { - "expression": "peer_instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_lapsed_copy_record_class_record_id_pk": { - "name": "federation_lapsed_copy_record_class_record_id_pk", - "columns": [ - "record_class", - "record_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete','liveness')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_cursor": { - "name": "federation_peer_cursor", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_key": { - "name": "federation_peer_key", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "anchor": { - "name": "anchor", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "learned_at": { - "name": "learned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_peer_key_peer_instance_id_key_id_pk": { - "name": "federation_peer_key_peer_instance_id_key_id_pk", - "columns": [ - "peer_instance_id", - "key_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_source_receipt": { - "name": "federation_source_receipt", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_received_at": { - "name": "last_received_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "liveness_at": { - "name": "liveness_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_source_receipt_peer_instance_id_source_id_pk": { - "name": "federation_source_receipt_peer_instance_id_source_id_pk", - "columns": [ - "peer_instance_id", - "source_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "uq_federation_subscription_target": { - "name": "uq_federation_subscription_target", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "delivery_mode", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "coalesce(\"inbox_url\", '')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"conditions\".\"federation_subscription\".\"delivery_mode\" <> 'sse'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.on_demand_fetch": { - "name": "on_demand_fetch", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "retry_at": { - "name": "retry_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "claimed_until": { - "name": "claimed_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "on_demand_fetch_source_id_cell_pk": { - "name": "on_demand_fetch_source_id_cell_pk", - "columns": [ - "source_id", - "cell" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "on_demand_fetch_status_enum": { - "name": "on_demand_fetch_status_enum", - "value": "\"conditions\".\"on_demand_fetch\".\"status\" IN ('pending','fresh','failed')" - } - }, - "isRLSEnabled": false - }, - "conditions.on_demand_quota": { - "name": "on_demand_quota", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "tokens": { - "name": "tokens", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "refilled_at": { - "name": "refilled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "day": { - "name": "day", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "day_count": { - "name": "day_count", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.public_license_policy": { - "name": "public_license_policy", - "schema": "conditions", - "columns": { - "license": { - "name": "license", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_shrink": { - "name": "source_shrink", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "since": { - "name": "since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "polls": { - "name": "polls", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "stated": { - "name": "stated", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "held": { - "name": "held", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "source_shrink_source_id_scope_pk": { - "name": "source_shrink_source_id_scope_pk", - "columns": [ - "source_id", - "scope" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_shrink_scope_enum": { - "name": "source_shrink_scope_enum", - "value": "\"conditions\".\"source_shrink\".\"scope\" IN ('series','records')" - } - }, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.oauth_grant": { - "name": "oauth_grant", - "schema": "conditions", - "columns": { - "grant_key": { - "name": "grant_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_issued_at": { - "name": "refresh_issued_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_expires_at": { - "name": "access_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "rejected_at": { - "name": "rejected_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "product": { - "name": "product", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "credit_name": { - "name": "credit_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_url": { - "name": "credit_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_notice": { - "name": "credit_notice", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "restricted": { - "name": "restricted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restricted_since": { - "name": "restricted_since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fusion_restricted": { - "name": "fusion_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "fusion_tier": { - "name": "fusion_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "fusion_licenses": { - "name": "fusion_licenses", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "federation_restricted": { - "name": "federation_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "federation_pending": { - "name": "federation_pending", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0085_snapshot.json b/packages/core/drizzle/meta/0085_snapshot.json deleted file mode 100644 index 2cca3d8e7..000000000 --- a/packages/core/drizzle/meta/0085_snapshot.json +++ /dev/null @@ -1,6228 +0,0 @@ -{ - "id": "71c00911-6fec-4f61-97af-62fa6dfed3b5", - "prevId": "8b9c769c-43e7-45e1-82e8-73057f14af55", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "isExpression": true, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.report_refusal": { - "name": "report_refusal", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_report_refusal_actor": { - "name": "idx_report_refusal_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_report_refusal_occurred": { - "name": "idx_report_refusal_occurred", - "columns": [ - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.contributor_receipt": { - "name": "contributor_receipt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "version": { - "name": "version", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "contributors": { - "name": "contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "provenance": { - "name": "provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "reading": { - "name": "reading", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template_hash": { - "name": "template_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_id": { - "name": "contributor_receipt_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "crowd_record_id": { - "name": "crowd_record_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_sources": { - "name": "fused_sources", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_public": { - "name": "fused_public", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_observation_latest_source": { - "name": "idx_observation_latest_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "series_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false - }, - "idx_observation_latest_effective_brin": { - "name": "idx_observation_latest_effective_brin", - "columns": [ - { - "expression": "effective_from", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "brin", - "concurrently": false - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "crowd_record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"observation_latest\".\"crowd_record_id\" IS NOT NULL", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "columnsFrom": [ - "series_id" - ], - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsTo": [ - "series_id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "columnsFrom": [ - "series_id" - ], - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsTo": [ - "series_id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "isExpression": true, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": { - "fastupdate": "off" - }, - "method": "gin", - "concurrently": false - }, - "idx_feature_rights_revoked": { - "name": "idx_feature_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"feature\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": { - "fastupdate": "off" - }, - "method": "gin", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "gin", - "concurrently": false - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "columnsFrom": [ - "feature_id" - ], - "tableTo": "feature", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\" COLLATE \"C\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "columnsFrom": [ - "feature_id" - ], - "tableTo": "feature", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_rights_revoked": { - "name": "idx_offer_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"offer\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "columnsFrom": [ - "offer_id" - ], - "tableTo": "offer", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false - }, - "idx_situation_rights_revoked": { - "name": "idx_situation_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"situation\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('none', 'minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "columnsFrom": [ - "situation_id" - ], - "tableTo": "situation", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "columnsFrom": [ - "situation_id" - ], - "tableTo": "situation", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_erasure": { - "name": "archive_erasure", - "schema": "conditions", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "applied_at": { - "name": "applied_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "endorsed_by": { - "name": "endorsed_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "endorsement": { - "name": "endorsement", - "type": "bytea", - "primaryKey": false, - "notNull": false - }, - "endorsement_proof": { - "name": "endorsement_proof", - "type": "bytea", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_lapsed_copy": { - "name": "federation_lapsed_copy", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "lapsed_at": { - "name": "lapsed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_lapsed_copy_source": { - "name": "idx_federation_lapsed_copy_source", - "columns": [ - { - "expression": "peer_instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_lapsed_copy_record_class_record_id_pk": { - "name": "federation_lapsed_copy_record_class_record_id_pk", - "columns": [ - "record_class", - "record_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete','liveness')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_cursor": { - "name": "federation_peer_cursor", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_key": { - "name": "federation_peer_key", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "anchor": { - "name": "anchor", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "learned_at": { - "name": "learned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_peer_key_peer_instance_id_key_id_pk": { - "name": "federation_peer_key_peer_instance_id_key_id_pk", - "columns": [ - "peer_instance_id", - "key_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_source_receipt": { - "name": "federation_source_receipt", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_received_at": { - "name": "last_received_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "liveness_at": { - "name": "liveness_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_source_receipt_peer_instance_id_source_id_pk": { - "name": "federation_source_receipt_peer_instance_id_source_id_pk", - "columns": [ - "peer_instance_id", - "source_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "uq_federation_subscription_target": { - "name": "uq_federation_subscription_target", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "delivery_mode", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "coalesce(\"inbox_url\", '')", - "isExpression": true, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"federation_subscription\".\"delivery_mode\" <> 'sse'", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.on_demand_fetch": { - "name": "on_demand_fetch", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "retry_at": { - "name": "retry_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "claimed_until": { - "name": "claimed_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "on_demand_fetch_source_id_cell_pk": { - "name": "on_demand_fetch_source_id_cell_pk", - "columns": [ - "source_id", - "cell" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "on_demand_fetch_status_enum": { - "name": "on_demand_fetch_status_enum", - "value": "\"conditions\".\"on_demand_fetch\".\"status\" IN ('pending','fresh','failed')" - } - }, - "isRLSEnabled": false - }, - "conditions.on_demand_quota": { - "name": "on_demand_quota", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "tokens": { - "name": "tokens", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "refilled_at": { - "name": "refilled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "day": { - "name": "day", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "day_count": { - "name": "day_count", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.public_license_policy": { - "name": "public_license_policy", - "schema": "conditions", - "columns": { - "license": { - "name": "license", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_shrink": { - "name": "source_shrink", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "since": { - "name": "since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "polls": { - "name": "polls", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "stated": { - "name": "stated", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "held": { - "name": "held", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "source_shrink_source_id_scope_pk": { - "name": "source_shrink_source_id_scope_pk", - "columns": [ - "source_id", - "scope" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_shrink_scope_enum": { - "name": "source_shrink_scope_enum", - "value": "\"conditions\".\"source_shrink\".\"scope\" IN ('series','records')" - } - }, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.oauth_grant": { - "name": "oauth_grant", - "schema": "conditions", - "columns": { - "grant_key": { - "name": "grant_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_issued_at": { - "name": "refresh_issued_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_expires_at": { - "name": "access_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "rejected_at": { - "name": "rejected_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "product": { - "name": "product", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "credit_name": { - "name": "credit_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_url": { - "name": "credit_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_notice": { - "name": "credit_notice", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "restricted": { - "name": "restricted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restricted_since": { - "name": "restricted_since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fusion_restricted": { - "name": "fusion_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "fusion_tier": { - "name": "fusion_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "fusion_licenses": { - "name": "fusion_licenses", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "federation_restricted": { - "name": "federation_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "federation_pending": { - "name": "federation_pending", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "views": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0086_snapshot.json b/packages/core/drizzle/meta/0086_snapshot.json deleted file mode 100644 index 97ba7bbe7..000000000 --- a/packages/core/drizzle/meta/0086_snapshot.json +++ /dev/null @@ -1,6271 +0,0 @@ -{ - "id": "6b964f32-9997-4f23-88c2-905db63002db", - "prevId": "71c00911-6fec-4f61-97af-62fa6dfed3b5", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.report_refusal": { - "name": "report_refusal", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_report_refusal_actor": { - "name": "idx_report_refusal_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_refusal_occurred": { - "name": "idx_report_refusal_occurred", - "columns": [ - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.contributor_receipt": { - "name": "contributor_receipt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "version": { - "name": "version", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "contributors": { - "name": "contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "provenance": { - "name": "provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "reading": { - "name": "reading", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template_hash": { - "name": "template_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_id": { - "name": "contributor_receipt_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "crowd_record_id": { - "name": "crowd_record_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_sources": { - "name": "fused_sources", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_public": { - "name": "fused_public", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_source": { - "name": "idx_observation_latest_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "series_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_effective_brin": { - "name": "idx_observation_latest_effective_brin", - "columns": [ - { - "expression": "effective_from", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "brin", - "with": {} - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "crowd_record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"crowd_record_id\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "nullsNotDistinct": false, - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ] - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - }, - "idx_feature_rights_revoked": { - "name": "idx_feature_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"feature\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\" COLLATE \"C\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_rights_revoked": { - "name": "idx_offer_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"offer\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "tableTo": "offer", - "schemaTo": "conditions", - "columnsFrom": [ - "offer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_rights_revoked": { - "name": "idx_situation_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('none', 'minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_erasure": { - "name": "archive_erasure", - "schema": "conditions", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "applied_at": { - "name": "applied_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_file": { - "name": "archive_file", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "file_name": { - "name": "file_name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sha256": { - "name": "sha256", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "bytes": { - "name": "bytes", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "built_at": { - "name": "built_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "endorsed_by": { - "name": "endorsed_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "endorsement": { - "name": "endorsement", - "type": "bytea", - "primaryKey": false, - "notNull": false - }, - "endorsement_proof": { - "name": "endorsement_proof", - "type": "bytea", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_lapsed_copy": { - "name": "federation_lapsed_copy", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "lapsed_at": { - "name": "lapsed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_lapsed_copy_source": { - "name": "idx_federation_lapsed_copy_source", - "columns": [ - { - "expression": "peer_instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_lapsed_copy_record_class_record_id_pk": { - "name": "federation_lapsed_copy_record_class_record_id_pk", - "columns": [ - "record_class", - "record_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete','liveness')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_cursor": { - "name": "federation_peer_cursor", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_key": { - "name": "federation_peer_key", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "anchor": { - "name": "anchor", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "learned_at": { - "name": "learned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_peer_key_peer_instance_id_key_id_pk": { - "name": "federation_peer_key_peer_instance_id_key_id_pk", - "columns": [ - "peer_instance_id", - "key_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_source_receipt": { - "name": "federation_source_receipt", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_received_at": { - "name": "last_received_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "liveness_at": { - "name": "liveness_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_source_receipt_peer_instance_id_source_id_pk": { - "name": "federation_source_receipt_peer_instance_id_source_id_pk", - "columns": [ - "peer_instance_id", - "source_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "uq_federation_subscription_target": { - "name": "uq_federation_subscription_target", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "delivery_mode", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "coalesce(\"inbox_url\", '')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"conditions\".\"federation_subscription\".\"delivery_mode\" <> 'sse'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.on_demand_fetch": { - "name": "on_demand_fetch", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "retry_at": { - "name": "retry_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "claimed_until": { - "name": "claimed_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "on_demand_fetch_source_id_cell_pk": { - "name": "on_demand_fetch_source_id_cell_pk", - "columns": [ - "source_id", - "cell" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "on_demand_fetch_status_enum": { - "name": "on_demand_fetch_status_enum", - "value": "\"conditions\".\"on_demand_fetch\".\"status\" IN ('pending','fresh','failed')" - } - }, - "isRLSEnabled": false - }, - "conditions.on_demand_quota": { - "name": "on_demand_quota", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "tokens": { - "name": "tokens", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "refilled_at": { - "name": "refilled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "day": { - "name": "day", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "day_count": { - "name": "day_count", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.public_license_policy": { - "name": "public_license_policy", - "schema": "conditions", - "columns": { - "license": { - "name": "license", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_shrink": { - "name": "source_shrink", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "since": { - "name": "since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "polls": { - "name": "polls", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "stated": { - "name": "stated", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "held": { - "name": "held", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "source_shrink_source_id_scope_pk": { - "name": "source_shrink_source_id_scope_pk", - "columns": [ - "source_id", - "scope" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_shrink_scope_enum": { - "name": "source_shrink_scope_enum", - "value": "\"conditions\".\"source_shrink\".\"scope\" IN ('series','records')" - } - }, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.oauth_grant": { - "name": "oauth_grant", - "schema": "conditions", - "columns": { - "grant_key": { - "name": "grant_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_issued_at": { - "name": "refresh_issued_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_expires_at": { - "name": "access_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "rejected_at": { - "name": "rejected_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "product": { - "name": "product", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "credit_name": { - "name": "credit_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_url": { - "name": "credit_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_notice": { - "name": "credit_notice", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "restricted": { - "name": "restricted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restricted_since": { - "name": "restricted_since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fusion_restricted": { - "name": "fusion_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "fusion_tier": { - "name": "fusion_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "fusion_licenses": { - "name": "fusion_licenses", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "federation_restricted": { - "name": "federation_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "federation_pending": { - "name": "federation_pending", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0087_snapshot.json b/packages/core/drizzle/meta/0087_snapshot.json deleted file mode 100644 index f66ceb5cc..000000000 --- a/packages/core/drizzle/meta/0087_snapshot.json +++ /dev/null @@ -1,6277 +0,0 @@ -{ - "id": "c7fc6c4a-395e-4997-b7d5-4e14f1c84281", - "prevId": "6b964f32-9997-4f23-88c2-905db63002db", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.report_refusal": { - "name": "report_refusal", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_report_refusal_actor": { - "name": "idx_report_refusal_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_refusal_occurred": { - "name": "idx_report_refusal_occurred", - "columns": [ - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.contributor_receipt": { - "name": "contributor_receipt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "version": { - "name": "version", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "contributors": { - "name": "contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "provenance": { - "name": "provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "reading": { - "name": "reading", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template_hash": { - "name": "template_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_id": { - "name": "contributor_receipt_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "crowd_record_id": { - "name": "crowd_record_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_sources": { - "name": "fused_sources", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_public": { - "name": "fused_public", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_source": { - "name": "idx_observation_latest_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "series_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_effective_brin": { - "name": "idx_observation_latest_effective_brin", - "columns": [ - { - "expression": "effective_from", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "brin", - "with": {} - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "crowd_record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"crowd_record_id\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "nullsNotDistinct": false, - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ] - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - }, - "idx_feature_rights_revoked": { - "name": "idx_feature_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"feature\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\" COLLATE \"C\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_rights_revoked": { - "name": "idx_offer_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"offer\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "tableTo": "offer", - "schemaTo": "conditions", - "columnsFrom": [ - "offer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_rights_revoked": { - "name": "idx_situation_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('none', 'minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_erasure": { - "name": "archive_erasure", - "schema": "conditions", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "applied_at": { - "name": "applied_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_file": { - "name": "archive_file", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "file_name": { - "name": "file_name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sha256": { - "name": "sha256", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "bytes": { - "name": "bytes", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "built_at": { - "name": "built_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "endorsed_by": { - "name": "endorsed_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "endorsement": { - "name": "endorsement", - "type": "bytea", - "primaryKey": false, - "notNull": false - }, - "endorsement_proof": { - "name": "endorsement_proof", - "type": "bytea", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_lapsed_copy": { - "name": "federation_lapsed_copy", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "lapsed_at": { - "name": "lapsed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_lapsed_copy_source": { - "name": "idx_federation_lapsed_copy_source", - "columns": [ - { - "expression": "peer_instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_lapsed_copy_record_class_record_id_pk": { - "name": "federation_lapsed_copy_record_class_record_id_pk", - "columns": [ - "record_class", - "record_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete','liveness')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_cursor": { - "name": "federation_peer_cursor", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_key": { - "name": "federation_peer_key", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "anchor": { - "name": "anchor", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "learned_at": { - "name": "learned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_peer_key_peer_instance_id_key_id_pk": { - "name": "federation_peer_key_peer_instance_id_key_id_pk", - "columns": [ - "peer_instance_id", - "key_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_source_receipt": { - "name": "federation_source_receipt", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_received_at": { - "name": "last_received_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "liveness_at": { - "name": "liveness_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_source_receipt_peer_instance_id_source_id_pk": { - "name": "federation_source_receipt_peer_instance_id_source_id_pk", - "columns": [ - "peer_instance_id", - "source_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "uq_federation_subscription_target": { - "name": "uq_federation_subscription_target", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "delivery_mode", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "coalesce(\"inbox_url\", '')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"conditions\".\"federation_subscription\".\"delivery_mode\" <> 'sse'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.on_demand_fetch": { - "name": "on_demand_fetch", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "retry_at": { - "name": "retry_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "claimed_until": { - "name": "claimed_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "on_demand_fetch_source_id_cell_pk": { - "name": "on_demand_fetch_source_id_cell_pk", - "columns": [ - "source_id", - "cell" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "on_demand_fetch_status_enum": { - "name": "on_demand_fetch_status_enum", - "value": "\"conditions\".\"on_demand_fetch\".\"status\" IN ('pending','fresh','failed')" - } - }, - "isRLSEnabled": false - }, - "conditions.on_demand_quota": { - "name": "on_demand_quota", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "tokens": { - "name": "tokens", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "refilled_at": { - "name": "refilled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "day": { - "name": "day", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "day_count": { - "name": "day_count", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.public_license_policy": { - "name": "public_license_policy", - "schema": "conditions", - "columns": { - "license": { - "name": "license", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_shrink": { - "name": "source_shrink", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "since": { - "name": "since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "polls": { - "name": "polls", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "stated": { - "name": "stated", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "held": { - "name": "held", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "source_shrink_source_id_scope_pk": { - "name": "source_shrink_source_id_scope_pk", - "columns": [ - "source_id", - "scope" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_shrink_scope_enum": { - "name": "source_shrink_scope_enum", - "value": "\"conditions\".\"source_shrink\".\"scope\" IN ('series','records')" - } - }, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.oauth_grant": { - "name": "oauth_grant", - "schema": "conditions", - "columns": { - "grant_key": { - "name": "grant_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_issued_at": { - "name": "refresh_issued_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_expires_at": { - "name": "access_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "rejected_at": { - "name": "rejected_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "product": { - "name": "product", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "credit_name": { - "name": "credit_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_url": { - "name": "credit_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_notice": { - "name": "credit_notice", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "restricted": { - "name": "restricted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restricted_since": { - "name": "restricted_since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fusion_restricted": { - "name": "fusion_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "fusion_tier": { - "name": "fusion_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "fusion_licenses": { - "name": "fusion_licenses", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "federation_restricted": { - "name": "federation_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "federation_pending": { - "name": "federation_pending", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0088_snapshot.json b/packages/core/drizzle/meta/0088_snapshot.json deleted file mode 100644 index e6d96b03b..000000000 --- a/packages/core/drizzle/meta/0088_snapshot.json +++ /dev/null @@ -1,6289 +0,0 @@ -{ - "id": "588e19b1-ed2b-426e-a037-7ae19c10af4d", - "prevId": "c7fc6c4a-395e-4997-b7d5-4e14f1c84281", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.report_refusal": { - "name": "report_refusal", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_report_refusal_actor": { - "name": "idx_report_refusal_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_refusal_occurred": { - "name": "idx_report_refusal_occurred", - "columns": [ - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.contributor_receipt": { - "name": "contributor_receipt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "version": { - "name": "version", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "contributors": { - "name": "contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "provenance": { - "name": "provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "reading": { - "name": "reading", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template_hash": { - "name": "template_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_id": { - "name": "contributor_receipt_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "crowd_record_id": { - "name": "crowd_record_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_sources": { - "name": "fused_sources", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_public": { - "name": "fused_public", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_source": { - "name": "idx_observation_latest_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "series_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_effective_brin": { - "name": "idx_observation_latest_effective_brin", - "columns": [ - { - "expression": "effective_from", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "brin", - "with": {} - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "crowd_record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"crowd_record_id\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "nullsNotDistinct": false, - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ] - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - }, - "idx_feature_rights_revoked": { - "name": "idx_feature_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"feature\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\" COLLATE \"C\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_rights_revoked": { - "name": "idx_offer_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"offer\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "tableTo": "offer", - "schemaTo": "conditions", - "columnsFrom": [ - "offer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_rights_revoked": { - "name": "idx_situation_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('none', 'minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_erasure": { - "name": "archive_erasure", - "schema": "conditions", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "applied_at": { - "name": "applied_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_file": { - "name": "archive_file", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "file_name": { - "name": "file_name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sha256": { - "name": "sha256", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "bytes": { - "name": "bytes", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "built_at": { - "name": "built_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "endorsed_by": { - "name": "endorsed_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "endorsement": { - "name": "endorsement", - "type": "bytea", - "primaryKey": false, - "notNull": false - }, - "endorsement_proof": { - "name": "endorsement_proof", - "type": "bytea", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_lapsed_copy": { - "name": "federation_lapsed_copy", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "lapsed_at": { - "name": "lapsed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_lapsed_copy_source": { - "name": "idx_federation_lapsed_copy_source", - "columns": [ - { - "expression": "peer_instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_lapsed_copy_record_class_record_id_pk": { - "name": "federation_lapsed_copy_record_class_record_id_pk", - "columns": [ - "record_class", - "record_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete','liveness')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_cursor": { - "name": "federation_peer_cursor", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "archive_built_at": { - "name": "archive_built_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "archive_landed_at": { - "name": "archive_landed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_key": { - "name": "federation_peer_key", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "anchor": { - "name": "anchor", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "learned_at": { - "name": "learned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_peer_key_peer_instance_id_key_id_pk": { - "name": "federation_peer_key_peer_instance_id_key_id_pk", - "columns": [ - "peer_instance_id", - "key_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_source_receipt": { - "name": "federation_source_receipt", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_received_at": { - "name": "last_received_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "liveness_at": { - "name": "liveness_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_source_receipt_peer_instance_id_source_id_pk": { - "name": "federation_source_receipt_peer_instance_id_source_id_pk", - "columns": [ - "peer_instance_id", - "source_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "uq_federation_subscription_target": { - "name": "uq_federation_subscription_target", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "delivery_mode", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "coalesce(\"inbox_url\", '')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"conditions\".\"federation_subscription\".\"delivery_mode\" <> 'sse'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.on_demand_fetch": { - "name": "on_demand_fetch", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "retry_at": { - "name": "retry_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "claimed_until": { - "name": "claimed_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "on_demand_fetch_source_id_cell_pk": { - "name": "on_demand_fetch_source_id_cell_pk", - "columns": [ - "source_id", - "cell" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "on_demand_fetch_status_enum": { - "name": "on_demand_fetch_status_enum", - "value": "\"conditions\".\"on_demand_fetch\".\"status\" IN ('pending','fresh','failed')" - } - }, - "isRLSEnabled": false - }, - "conditions.on_demand_quota": { - "name": "on_demand_quota", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "tokens": { - "name": "tokens", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "refilled_at": { - "name": "refilled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "day": { - "name": "day", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "day_count": { - "name": "day_count", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.public_license_policy": { - "name": "public_license_policy", - "schema": "conditions", - "columns": { - "license": { - "name": "license", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_shrink": { - "name": "source_shrink", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "since": { - "name": "since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "polls": { - "name": "polls", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "stated": { - "name": "stated", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "held": { - "name": "held", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "source_shrink_source_id_scope_pk": { - "name": "source_shrink_source_id_scope_pk", - "columns": [ - "source_id", - "scope" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_shrink_scope_enum": { - "name": "source_shrink_scope_enum", - "value": "\"conditions\".\"source_shrink\".\"scope\" IN ('series','records')" - } - }, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.oauth_grant": { - "name": "oauth_grant", - "schema": "conditions", - "columns": { - "grant_key": { - "name": "grant_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_issued_at": { - "name": "refresh_issued_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_expires_at": { - "name": "access_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "rejected_at": { - "name": "rejected_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "product": { - "name": "product", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "credit_name": { - "name": "credit_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_url": { - "name": "credit_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_notice": { - "name": "credit_notice", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "restricted": { - "name": "restricted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restricted_since": { - "name": "restricted_since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fusion_restricted": { - "name": "fusion_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "fusion_tier": { - "name": "fusion_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "fusion_licenses": { - "name": "fusion_licenses", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "federation_restricted": { - "name": "federation_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "federation_pending": { - "name": "federation_pending", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0089_snapshot.json b/packages/core/drizzle/meta/0089_snapshot.json deleted file mode 100644 index c2fe9cac3..000000000 --- a/packages/core/drizzle/meta/0089_snapshot.json +++ /dev/null @@ -1,6289 +0,0 @@ -{ - "id": "1d20cd79-144a-4a12-a365-46ad9ee2ee1b", - "prevId": "588e19b1-ed2b-426e-a037-7ae19c10af4d", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "isExpression": true, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.report_refusal": { - "name": "report_refusal", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_report_refusal_actor": { - "name": "idx_report_refusal_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_report_refusal_occurred": { - "name": "idx_report_refusal_occurred", - "columns": [ - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.contributor_receipt": { - "name": "contributor_receipt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "version": { - "name": "version", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "contributors": { - "name": "contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "provenance": { - "name": "provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "reading": { - "name": "reading", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template_hash": { - "name": "template_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_id": { - "name": "contributor_receipt_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "crowd_record_id": { - "name": "crowd_record_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_sources": { - "name": "fused_sources", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_public": { - "name": "fused_public", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_observation_latest_source": { - "name": "idx_observation_latest_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "series_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false - }, - "idx_observation_latest_effective_brin": { - "name": "idx_observation_latest_effective_brin", - "columns": [ - { - "expression": "effective_from", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "brin", - "concurrently": false - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "crowd_record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"observation_latest\".\"crowd_record_id\" IS NOT NULL", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "columnsFrom": [ - "series_id" - ], - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsTo": [ - "series_id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "columnsFrom": [ - "series_id" - ], - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsTo": [ - "series_id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "isExpression": true, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": { - "fastupdate": "off" - }, - "method": "gin", - "concurrently": false - }, - "idx_feature_rights_revoked": { - "name": "idx_feature_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"feature\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": { - "fastupdate": "off" - }, - "method": "gin", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "gin", - "concurrently": false - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "columnsFrom": [ - "feature_id" - ], - "tableTo": "feature", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\" COLLATE \"C\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "columnsFrom": [ - "feature_id" - ], - "tableTo": "feature", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_rights_revoked": { - "name": "idx_offer_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"offer\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "columnsFrom": [ - "offer_id" - ], - "tableTo": "offer", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false - }, - "idx_situation_rights_revoked": { - "name": "idx_situation_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"situation\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('none', 'minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "columnsFrom": [ - "situation_id" - ], - "tableTo": "situation", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "columnsFrom": [ - "situation_id" - ], - "tableTo": "situation", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_erasure": { - "name": "archive_erasure", - "schema": "conditions", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "applied_at": { - "name": "applied_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_file": { - "name": "archive_file", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "file_name": { - "name": "file_name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sha256": { - "name": "sha256", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "bytes": { - "name": "bytes", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "built_at": { - "name": "built_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "endorsed_by": { - "name": "endorsed_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "endorsement": { - "name": "endorsement", - "type": "bytea", - "primaryKey": false, - "notNull": false - }, - "endorsement_proof": { - "name": "endorsement_proof", - "type": "bytea", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_lapsed_copy": { - "name": "federation_lapsed_copy", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "lapsed_at": { - "name": "lapsed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_lapsed_copy_source": { - "name": "idx_federation_lapsed_copy_source", - "columns": [ - { - "expression": "peer_instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_lapsed_copy_record_class_record_id_pk": { - "name": "federation_lapsed_copy_record_class_record_id_pk", - "columns": [ - "record_class", - "record_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete','liveness')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_cursor": { - "name": "federation_peer_cursor", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "archive_built_at": { - "name": "archive_built_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "archive_landed_at": { - "name": "archive_landed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_key": { - "name": "federation_peer_key", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "anchor": { - "name": "anchor", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "learned_at": { - "name": "learned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_peer_key_peer_instance_id_key_id_pk": { - "name": "federation_peer_key_peer_instance_id_key_id_pk", - "columns": [ - "peer_instance_id", - "key_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_source_receipt": { - "name": "federation_source_receipt", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_received_at": { - "name": "last_received_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "liveness_at": { - "name": "liveness_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_source_receipt_peer_instance_id_source_id_pk": { - "name": "federation_source_receipt_peer_instance_id_source_id_pk", - "columns": [ - "peer_instance_id", - "source_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "uq_federation_subscription_target": { - "name": "uq_federation_subscription_target", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "delivery_mode", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "coalesce(\"inbox_url\", '')", - "isExpression": true, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"federation_subscription\".\"delivery_mode\" <> 'sse'", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.on_demand_fetch": { - "name": "on_demand_fetch", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "retry_at": { - "name": "retry_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "claimed_until": { - "name": "claimed_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "on_demand_fetch_source_id_cell_pk": { - "name": "on_demand_fetch_source_id_cell_pk", - "columns": [ - "source_id", - "cell" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "on_demand_fetch_status_enum": { - "name": "on_demand_fetch_status_enum", - "value": "\"conditions\".\"on_demand_fetch\".\"status\" IN ('pending','fresh','failed')" - } - }, - "isRLSEnabled": false - }, - "conditions.on_demand_quota": { - "name": "on_demand_quota", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "tokens": { - "name": "tokens", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "refilled_at": { - "name": "refilled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "day": { - "name": "day", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "day_count": { - "name": "day_count", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.public_license_policy": { - "name": "public_license_policy", - "schema": "conditions", - "columns": { - "license": { - "name": "license", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_shrink": { - "name": "source_shrink", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "since": { - "name": "since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "polls": { - "name": "polls", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "stated": { - "name": "stated", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "held": { - "name": "held", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "source_shrink_source_id_scope_pk": { - "name": "source_shrink_source_id_scope_pk", - "columns": [ - "source_id", - "scope" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_shrink_scope_enum": { - "name": "source_shrink_scope_enum", - "value": "\"conditions\".\"source_shrink\".\"scope\" IN ('series','records')" - } - }, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.oauth_grant": { - "name": "oauth_grant", - "schema": "conditions", - "columns": { - "grant_key": { - "name": "grant_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_issued_at": { - "name": "refresh_issued_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_expires_at": { - "name": "access_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "rejected_at": { - "name": "rejected_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "product": { - "name": "product", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "credit_name": { - "name": "credit_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_url": { - "name": "credit_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_notice": { - "name": "credit_notice", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "restricted": { - "name": "restricted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restricted_since": { - "name": "restricted_since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fusion_restricted": { - "name": "fusion_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "fusion_tier": { - "name": "fusion_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "fusion_licenses": { - "name": "fusion_licenses", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "federation_restricted": { - "name": "federation_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "federation_pending": { - "name": "federation_pending", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "views": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0090_snapshot.json b/packages/core/drizzle/meta/0090_snapshot.json deleted file mode 100644 index 89b0e864f..000000000 --- a/packages/core/drizzle/meta/0090_snapshot.json +++ /dev/null @@ -1,6289 +0,0 @@ -{ - "id": "22b6b495-ced9-422c-bade-2e74c2c920fc", - "prevId": "1d20cd79-144a-4a12-a365-46ad9ee2ee1b", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "isExpression": true, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.report_refusal": { - "name": "report_refusal", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_report_refusal_actor": { - "name": "idx_report_refusal_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_report_refusal_occurred": { - "name": "idx_report_refusal_occurred", - "columns": [ - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.contributor_receipt": { - "name": "contributor_receipt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "version": { - "name": "version", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "contributors": { - "name": "contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "provenance": { - "name": "provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "reading": { - "name": "reading", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template_hash": { - "name": "template_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_id": { - "name": "contributor_receipt_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "crowd_record_id": { - "name": "crowd_record_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_sources": { - "name": "fused_sources", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_public": { - "name": "fused_public", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_observation_latest_source": { - "name": "idx_observation_latest_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "series_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false - }, - "idx_observation_latest_effective_brin": { - "name": "idx_observation_latest_effective_brin", - "columns": [ - { - "expression": "effective_from", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "brin", - "concurrently": false - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "crowd_record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"observation_latest\".\"crowd_record_id\" IS NOT NULL", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "columnsFrom": [ - "series_id" - ], - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsTo": [ - "series_id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "columnsFrom": [ - "series_id" - ], - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsTo": [ - "series_id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "isExpression": true, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": { - "fastupdate": "off" - }, - "method": "gin", - "concurrently": false - }, - "idx_feature_rights_revoked": { - "name": "idx_feature_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"feature\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": { - "fastupdate": "off" - }, - "method": "gin", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "gin", - "concurrently": false - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "columnsFrom": [ - "feature_id" - ], - "tableTo": "feature", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\" COLLATE \"C\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "columnsFrom": [ - "feature_id" - ], - "tableTo": "feature", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_rights_revoked": { - "name": "idx_offer_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"offer\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "columnsFrom": [ - "offer_id" - ], - "tableTo": "offer", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false - }, - "idx_situation_rights_revoked": { - "name": "idx_situation_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"situation\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('none', 'minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "columnsFrom": [ - "situation_id" - ], - "tableTo": "situation", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "columnsFrom": [ - "situation_id" - ], - "tableTo": "situation", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_erasure": { - "name": "archive_erasure", - "schema": "conditions", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "applied_at": { - "name": "applied_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_file": { - "name": "archive_file", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "file_name": { - "name": "file_name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sha256": { - "name": "sha256", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "bytes": { - "name": "bytes", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "built_at": { - "name": "built_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "endorsed_by": { - "name": "endorsed_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "endorsement": { - "name": "endorsement", - "type": "bytea", - "primaryKey": false, - "notNull": false - }, - "endorsement_proof": { - "name": "endorsement_proof", - "type": "bytea", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_lapsed_copy": { - "name": "federation_lapsed_copy", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "lapsed_at": { - "name": "lapsed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_lapsed_copy_source": { - "name": "idx_federation_lapsed_copy_source", - "columns": [ - { - "expression": "peer_instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_lapsed_copy_record_class_record_id_pk": { - "name": "federation_lapsed_copy_record_class_record_id_pk", - "columns": [ - "record_class", - "record_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete','liveness')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_cursor": { - "name": "federation_peer_cursor", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "archive_built_at": { - "name": "archive_built_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "archive_landed_at": { - "name": "archive_landed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_key": { - "name": "federation_peer_key", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "anchor": { - "name": "anchor", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "learned_at": { - "name": "learned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_peer_key_peer_instance_id_key_id_pk": { - "name": "federation_peer_key_peer_instance_id_key_id_pk", - "columns": [ - "peer_instance_id", - "key_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_source_receipt": { - "name": "federation_source_receipt", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_received_at": { - "name": "last_received_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "liveness_at": { - "name": "liveness_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_source_receipt_peer_instance_id_source_id_pk": { - "name": "federation_source_receipt_peer_instance_id_source_id_pk", - "columns": [ - "peer_instance_id", - "source_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "uq_federation_subscription_target": { - "name": "uq_federation_subscription_target", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "delivery_mode", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "coalesce(\"inbox_url\", '')", - "isExpression": true, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"federation_subscription\".\"delivery_mode\" <> 'sse'", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.on_demand_fetch": { - "name": "on_demand_fetch", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "retry_at": { - "name": "retry_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "claimed_until": { - "name": "claimed_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "on_demand_fetch_source_id_cell_pk": { - "name": "on_demand_fetch_source_id_cell_pk", - "columns": [ - "source_id", - "cell" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "on_demand_fetch_status_enum": { - "name": "on_demand_fetch_status_enum", - "value": "\"conditions\".\"on_demand_fetch\".\"status\" IN ('pending','fresh','failed')" - } - }, - "isRLSEnabled": false - }, - "conditions.on_demand_quota": { - "name": "on_demand_quota", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "tokens": { - "name": "tokens", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "refilled_at": { - "name": "refilled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "day": { - "name": "day", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "day_count": { - "name": "day_count", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.public_license_policy": { - "name": "public_license_policy", - "schema": "conditions", - "columns": { - "license": { - "name": "license", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_shrink": { - "name": "source_shrink", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "since": { - "name": "since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "polls": { - "name": "polls", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "stated": { - "name": "stated", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "held": { - "name": "held", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "source_shrink_source_id_scope_pk": { - "name": "source_shrink_source_id_scope_pk", - "columns": [ - "source_id", - "scope" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_shrink_scope_enum": { - "name": "source_shrink_scope_enum", - "value": "\"conditions\".\"source_shrink\".\"scope\" IN ('series','records')" - } - }, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.oauth_grant": { - "name": "oauth_grant", - "schema": "conditions", - "columns": { - "grant_key": { - "name": "grant_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_issued_at": { - "name": "refresh_issued_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_expires_at": { - "name": "access_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "rejected_at": { - "name": "rejected_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "product": { - "name": "product", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "credit_name": { - "name": "credit_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_url": { - "name": "credit_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_notice": { - "name": "credit_notice", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "restricted": { - "name": "restricted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restricted_since": { - "name": "restricted_since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fusion_restricted": { - "name": "fusion_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "fusion_tier": { - "name": "fusion_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "fusion_licenses": { - "name": "fusion_licenses", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "federation_restricted": { - "name": "federation_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "federation_pending": { - "name": "federation_pending", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "views": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0091_snapshot.json b/packages/core/drizzle/meta/0091_snapshot.json deleted file mode 100644 index 550f243fe..000000000 --- a/packages/core/drizzle/meta/0091_snapshot.json +++ /dev/null @@ -1,6289 +0,0 @@ -{ - "id": "0d4c9cd5-fcfe-4afb-8fac-7f34f325a2ba", - "prevId": "22b6b495-ced9-422c-bade-2e74c2c920fc", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "isExpression": true, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.report_refusal": { - "name": "report_refusal", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_report_refusal_actor": { - "name": "idx_report_refusal_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_report_refusal_occurred": { - "name": "idx_report_refusal_occurred", - "columns": [ - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.contributor_receipt": { - "name": "contributor_receipt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "version": { - "name": "version", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "contributors": { - "name": "contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "provenance": { - "name": "provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "reading": { - "name": "reading", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template_hash": { - "name": "template_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_id": { - "name": "contributor_receipt_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "crowd_record_id": { - "name": "crowd_record_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_sources": { - "name": "fused_sources", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_public": { - "name": "fused_public", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_observation_latest_source": { - "name": "idx_observation_latest_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "series_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false - }, - "idx_observation_latest_effective_brin": { - "name": "idx_observation_latest_effective_brin", - "columns": [ - { - "expression": "effective_from", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "brin", - "concurrently": false - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "crowd_record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"observation_latest\".\"crowd_record_id\" IS NOT NULL", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "columnsFrom": [ - "series_id" - ], - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsTo": [ - "series_id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "columnsFrom": [ - "series_id" - ], - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsTo": [ - "series_id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "isExpression": true, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": { - "fastupdate": "off" - }, - "method": "gin", - "concurrently": false - }, - "idx_feature_rights_revoked": { - "name": "idx_feature_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"feature\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": { - "fastupdate": "off" - }, - "method": "gin", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "gin", - "concurrently": false - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "columnsFrom": [ - "feature_id" - ], - "tableTo": "feature", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\" COLLATE \"C\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "columnsFrom": [ - "feature_id" - ], - "tableTo": "feature", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_rights_revoked": { - "name": "idx_offer_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"offer\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "columnsFrom": [ - "offer_id" - ], - "tableTo": "offer", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false - }, - "idx_situation_rights_revoked": { - "name": "idx_situation_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"situation\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('none', 'minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "columnsFrom": [ - "situation_id" - ], - "tableTo": "situation", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "columnsFrom": [ - "situation_id" - ], - "tableTo": "situation", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_erasure": { - "name": "archive_erasure", - "schema": "conditions", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "applied_at": { - "name": "applied_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_file": { - "name": "archive_file", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "file_name": { - "name": "file_name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sha256": { - "name": "sha256", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "bytes": { - "name": "bytes", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "built_at": { - "name": "built_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "endorsed_by": { - "name": "endorsed_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "endorsement": { - "name": "endorsement", - "type": "bytea", - "primaryKey": false, - "notNull": false - }, - "endorsement_proof": { - "name": "endorsement_proof", - "type": "bytea", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_lapsed_copy": { - "name": "federation_lapsed_copy", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "lapsed_at": { - "name": "lapsed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_lapsed_copy_source": { - "name": "idx_federation_lapsed_copy_source", - "columns": [ - { - "expression": "peer_instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_lapsed_copy_record_class_record_id_pk": { - "name": "federation_lapsed_copy_record_class_record_id_pk", - "columns": [ - "record_class", - "record_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete','liveness')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_cursor": { - "name": "federation_peer_cursor", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "archive_built_at": { - "name": "archive_built_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "archive_landed_at": { - "name": "archive_landed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_key": { - "name": "federation_peer_key", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "anchor": { - "name": "anchor", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "learned_at": { - "name": "learned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_peer_key_peer_instance_id_key_id_pk": { - "name": "federation_peer_key_peer_instance_id_key_id_pk", - "columns": [ - "peer_instance_id", - "key_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_source_receipt": { - "name": "federation_source_receipt", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_received_at": { - "name": "last_received_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "liveness_at": { - "name": "liveness_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_source_receipt_peer_instance_id_source_id_pk": { - "name": "federation_source_receipt_peer_instance_id_source_id_pk", - "columns": [ - "peer_instance_id", - "source_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "uq_federation_subscription_target": { - "name": "uq_federation_subscription_target", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "delivery_mode", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "coalesce(\"inbox_url\", '')", - "isExpression": true, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"federation_subscription\".\"delivery_mode\" <> 'sse'", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.on_demand_fetch": { - "name": "on_demand_fetch", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "retry_at": { - "name": "retry_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "claimed_until": { - "name": "claimed_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "on_demand_fetch_source_id_cell_pk": { - "name": "on_demand_fetch_source_id_cell_pk", - "columns": [ - "source_id", - "cell" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "on_demand_fetch_status_enum": { - "name": "on_demand_fetch_status_enum", - "value": "\"conditions\".\"on_demand_fetch\".\"status\" IN ('pending','fresh','failed')" - } - }, - "isRLSEnabled": false - }, - "conditions.on_demand_quota": { - "name": "on_demand_quota", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "tokens": { - "name": "tokens", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "refilled_at": { - "name": "refilled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "day": { - "name": "day", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "day_count": { - "name": "day_count", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.public_license_policy": { - "name": "public_license_policy", - "schema": "conditions", - "columns": { - "license": { - "name": "license", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_shrink": { - "name": "source_shrink", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "since": { - "name": "since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "polls": { - "name": "polls", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "stated": { - "name": "stated", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "held": { - "name": "held", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "source_shrink_source_id_scope_pk": { - "name": "source_shrink_source_id_scope_pk", - "columns": [ - "source_id", - "scope" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_shrink_scope_enum": { - "name": "source_shrink_scope_enum", - "value": "\"conditions\".\"source_shrink\".\"scope\" IN ('series','records')" - } - }, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.oauth_grant": { - "name": "oauth_grant", - "schema": "conditions", - "columns": { - "grant_key": { - "name": "grant_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_issued_at": { - "name": "refresh_issued_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_expires_at": { - "name": "access_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "rejected_at": { - "name": "rejected_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "product": { - "name": "product", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "credit_name": { - "name": "credit_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_url": { - "name": "credit_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_notice": { - "name": "credit_notice", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "restricted": { - "name": "restricted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restricted_since": { - "name": "restricted_since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fusion_restricted": { - "name": "fusion_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "fusion_tier": { - "name": "fusion_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "fusion_licenses": { - "name": "fusion_licenses", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "federation_restricted": { - "name": "federation_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "federation_pending": { - "name": "federation_pending", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "views": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0092_snapshot.json b/packages/core/drizzle/meta/0092_snapshot.json deleted file mode 100644 index 57f8846ce..000000000 --- a/packages/core/drizzle/meta/0092_snapshot.json +++ /dev/null @@ -1,6289 +0,0 @@ -{ - "id": "975f1678-b6d3-4483-b24f-e3233700e8b0", - "prevId": "0d4c9cd5-fcfe-4afb-8fac-7f34f325a2ba", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "isExpression": true, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.report_refusal": { - "name": "report_refusal", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_report_refusal_actor": { - "name": "idx_report_refusal_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_report_refusal_occurred": { - "name": "idx_report_refusal_occurred", - "columns": [ - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.contributor_receipt": { - "name": "contributor_receipt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "version": { - "name": "version", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "contributors": { - "name": "contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "provenance": { - "name": "provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "reading": { - "name": "reading", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template_hash": { - "name": "template_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_id": { - "name": "contributor_receipt_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "crowd_record_id": { - "name": "crowd_record_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_sources": { - "name": "fused_sources", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_public": { - "name": "fused_public", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_observation_latest_source": { - "name": "idx_observation_latest_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "series_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false - }, - "idx_observation_latest_effective_brin": { - "name": "idx_observation_latest_effective_brin", - "columns": [ - { - "expression": "effective_from", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "brin", - "concurrently": false - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "crowd_record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"observation_latest\".\"crowd_record_id\" IS NOT NULL", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "columnsFrom": [ - "series_id" - ], - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsTo": [ - "series_id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "columnsFrom": [ - "series_id" - ], - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsTo": [ - "series_id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "isExpression": true, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": { - "fastupdate": "off" - }, - "method": "gin", - "concurrently": false - }, - "idx_feature_rights_revoked": { - "name": "idx_feature_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"feature\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": { - "fastupdate": "off" - }, - "method": "gin", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "gin", - "concurrently": false - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "columnsFrom": [ - "feature_id" - ], - "tableTo": "feature", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\" COLLATE \"C\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "columnsFrom": [ - "feature_id" - ], - "tableTo": "feature", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_rights_revoked": { - "name": "idx_offer_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"offer\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "columnsFrom": [ - "offer_id" - ], - "tableTo": "offer", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false - }, - "idx_situation_rights_revoked": { - "name": "idx_situation_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"situation\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('none', 'minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "columnsFrom": [ - "situation_id" - ], - "tableTo": "situation", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "columnsFrom": [ - "situation_id" - ], - "tableTo": "situation", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_erasure": { - "name": "archive_erasure", - "schema": "conditions", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "applied_at": { - "name": "applied_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_file": { - "name": "archive_file", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "file_name": { - "name": "file_name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sha256": { - "name": "sha256", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "bytes": { - "name": "bytes", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "built_at": { - "name": "built_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "endorsed_by": { - "name": "endorsed_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "endorsement": { - "name": "endorsement", - "type": "bytea", - "primaryKey": false, - "notNull": false - }, - "endorsement_proof": { - "name": "endorsement_proof", - "type": "bytea", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_lapsed_copy": { - "name": "federation_lapsed_copy", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "lapsed_at": { - "name": "lapsed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_lapsed_copy_source": { - "name": "idx_federation_lapsed_copy_source", - "columns": [ - { - "expression": "peer_instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_lapsed_copy_record_class_record_id_pk": { - "name": "federation_lapsed_copy_record_class_record_id_pk", - "columns": [ - "record_class", - "record_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete','liveness')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_cursor": { - "name": "federation_peer_cursor", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "archive_built_at": { - "name": "archive_built_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "archive_landed_at": { - "name": "archive_landed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_key": { - "name": "federation_peer_key", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "anchor": { - "name": "anchor", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "learned_at": { - "name": "learned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_peer_key_peer_instance_id_key_id_pk": { - "name": "federation_peer_key_peer_instance_id_key_id_pk", - "columns": [ - "peer_instance_id", - "key_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_source_receipt": { - "name": "federation_source_receipt", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_received_at": { - "name": "last_received_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "liveness_at": { - "name": "liveness_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_source_receipt_peer_instance_id_source_id_pk": { - "name": "federation_source_receipt_peer_instance_id_source_id_pk", - "columns": [ - "peer_instance_id", - "source_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "uq_federation_subscription_target": { - "name": "uq_federation_subscription_target", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "delivery_mode", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "coalesce(\"inbox_url\", '')", - "isExpression": true, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"federation_subscription\".\"delivery_mode\" <> 'sse'", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.on_demand_fetch": { - "name": "on_demand_fetch", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "retry_at": { - "name": "retry_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "claimed_until": { - "name": "claimed_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "on_demand_fetch_source_id_cell_pk": { - "name": "on_demand_fetch_source_id_cell_pk", - "columns": [ - "source_id", - "cell" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "on_demand_fetch_status_enum": { - "name": "on_demand_fetch_status_enum", - "value": "\"conditions\".\"on_demand_fetch\".\"status\" IN ('pending','fresh','failed')" - } - }, - "isRLSEnabled": false - }, - "conditions.on_demand_quota": { - "name": "on_demand_quota", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "tokens": { - "name": "tokens", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "refilled_at": { - "name": "refilled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "day": { - "name": "day", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "day_count": { - "name": "day_count", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.public_license_policy": { - "name": "public_license_policy", - "schema": "conditions", - "columns": { - "license": { - "name": "license", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_shrink": { - "name": "source_shrink", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "since": { - "name": "since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "polls": { - "name": "polls", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "stated": { - "name": "stated", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "held": { - "name": "held", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "source_shrink_source_id_scope_pk": { - "name": "source_shrink_source_id_scope_pk", - "columns": [ - "source_id", - "scope" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_shrink_scope_enum": { - "name": "source_shrink_scope_enum", - "value": "\"conditions\".\"source_shrink\".\"scope\" IN ('series','records')" - } - }, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.oauth_grant": { - "name": "oauth_grant", - "schema": "conditions", - "columns": { - "grant_key": { - "name": "grant_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_issued_at": { - "name": "refresh_issued_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_expires_at": { - "name": "access_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "rejected_at": { - "name": "rejected_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "product": { - "name": "product", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "credit_name": { - "name": "credit_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_url": { - "name": "credit_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_notice": { - "name": "credit_notice", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "restricted": { - "name": "restricted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restricted_since": { - "name": "restricted_since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fusion_restricted": { - "name": "fusion_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "fusion_tier": { - "name": "fusion_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "fusion_licenses": { - "name": "fusion_licenses", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "federation_restricted": { - "name": "federation_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "federation_pending": { - "name": "federation_pending", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "views": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0093_snapshot.json b/packages/core/drizzle/meta/0093_snapshot.json deleted file mode 100644 index 8ac1ec626..000000000 --- a/packages/core/drizzle/meta/0093_snapshot.json +++ /dev/null @@ -1,6295 +0,0 @@ -{ - "id": "97143600-94cf-4be9-b4e2-01fe08ae752c", - "prevId": "975f1678-b6d3-4483-b24f-e3233700e8b0", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.report_refusal": { - "name": "report_refusal", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_report_refusal_actor": { - "name": "idx_report_refusal_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_refusal_occurred": { - "name": "idx_report_refusal_occurred", - "columns": [ - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.contributor_receipt": { - "name": "contributor_receipt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "version": { - "name": "version", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "contributors": { - "name": "contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "provenance": { - "name": "provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "reading": { - "name": "reading", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template_hash": { - "name": "template_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_id": { - "name": "contributor_receipt_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "crowd_record_id": { - "name": "crowd_record_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_sources": { - "name": "fused_sources", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_public": { - "name": "fused_public", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_source": { - "name": "idx_observation_latest_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "series_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_effective_brin": { - "name": "idx_observation_latest_effective_brin", - "columns": [ - { - "expression": "effective_from", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "brin", - "with": {} - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "crowd_record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"crowd_record_id\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "nullsNotDistinct": false, - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ] - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - }, - "idx_feature_rights_revoked": { - "name": "idx_feature_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"feature\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\" COLLATE \"C\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_rights_revoked": { - "name": "idx_offer_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"offer\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "tableTo": "offer", - "schemaTo": "conditions", - "columnsFrom": [ - "offer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_rights_revoked": { - "name": "idx_situation_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('none', 'minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_erasure": { - "name": "archive_erasure", - "schema": "conditions", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "applied_at": { - "name": "applied_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_file": { - "name": "archive_file", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "file_name": { - "name": "file_name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sha256": { - "name": "sha256", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "bytes": { - "name": "bytes", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "built_at": { - "name": "built_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "endorsed_by": { - "name": "endorsed_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "endorsement": { - "name": "endorsement", - "type": "bytea", - "primaryKey": false, - "notNull": false - }, - "endorsement_proof": { - "name": "endorsement_proof", - "type": "bytea", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_lapsed_copy": { - "name": "federation_lapsed_copy", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "lapsed_at": { - "name": "lapsed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_lapsed_copy_source": { - "name": "idx_federation_lapsed_copy_source", - "columns": [ - { - "expression": "peer_instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_lapsed_copy_record_class_record_id_pk": { - "name": "federation_lapsed_copy_record_class_record_id_pk", - "columns": [ - "record_class", - "record_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete','liveness')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_cursor": { - "name": "federation_peer_cursor", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "archive_built_at": { - "name": "archive_built_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "archive_landed_at": { - "name": "archive_landed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_key": { - "name": "federation_peer_key", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "anchor": { - "name": "anchor", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "learned_at": { - "name": "learned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_peer_key_peer_instance_id_key_id_pk": { - "name": "federation_peer_key_peer_instance_id_key_id_pk", - "columns": [ - "peer_instance_id", - "key_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_source_receipt": { - "name": "federation_source_receipt", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_received_at": { - "name": "last_received_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "liveness_at": { - "name": "liveness_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_source_receipt_peer_instance_id_source_id_pk": { - "name": "federation_source_receipt_peer_instance_id_source_id_pk", - "columns": [ - "peer_instance_id", - "source_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "uq_federation_subscription_target": { - "name": "uq_federation_subscription_target", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "delivery_mode", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "coalesce(\"inbox_url\", '')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"conditions\".\"federation_subscription\".\"delivery_mode\" <> 'sse'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.on_demand_fetch": { - "name": "on_demand_fetch", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "retry_at": { - "name": "retry_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "claimed_until": { - "name": "claimed_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "on_demand_fetch_source_id_cell_pk": { - "name": "on_demand_fetch_source_id_cell_pk", - "columns": [ - "source_id", - "cell" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "on_demand_fetch_status_enum": { - "name": "on_demand_fetch_status_enum", - "value": "\"conditions\".\"on_demand_fetch\".\"status\" IN ('pending','fresh','failed')" - } - }, - "isRLSEnabled": false - }, - "conditions.on_demand_quota": { - "name": "on_demand_quota", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "tokens": { - "name": "tokens", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "refilled_at": { - "name": "refilled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "day": { - "name": "day", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "day_count": { - "name": "day_count", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.public_license_policy": { - "name": "public_license_policy", - "schema": "conditions", - "columns": { - "license": { - "name": "license", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_shrink": { - "name": "source_shrink", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "since": { - "name": "since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "polls": { - "name": "polls", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "stated": { - "name": "stated", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "held": { - "name": "held", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "source_shrink_source_id_scope_pk": { - "name": "source_shrink_source_id_scope_pk", - "columns": [ - "source_id", - "scope" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_shrink_scope_enum": { - "name": "source_shrink_scope_enum", - "value": "\"conditions\".\"source_shrink\".\"scope\" IN ('series','records')" - } - }, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "source_published_at": { - "name": "source_published_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.oauth_grant": { - "name": "oauth_grant", - "schema": "conditions", - "columns": { - "grant_key": { - "name": "grant_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_issued_at": { - "name": "refresh_issued_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_expires_at": { - "name": "access_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "rejected_at": { - "name": "rejected_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "product": { - "name": "product", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "credit_name": { - "name": "credit_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_url": { - "name": "credit_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_notice": { - "name": "credit_notice", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "restricted": { - "name": "restricted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restricted_since": { - "name": "restricted_since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fusion_restricted": { - "name": "fusion_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "fusion_tier": { - "name": "fusion_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "fusion_licenses": { - "name": "fusion_licenses", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "federation_restricted": { - "name": "federation_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "federation_pending": { - "name": "federation_pending", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0094_snapshot.json b/packages/core/drizzle/meta/0094_snapshot.json deleted file mode 100644 index 5a994c20e..000000000 --- a/packages/core/drizzle/meta/0094_snapshot.json +++ /dev/null @@ -1,6340 +0,0 @@ -{ - "id": "aaddd309-92cd-4835-92d3-263fee55294a", - "prevId": "97143600-94cf-4be9-b4e2-01fe08ae752c", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.report_refusal": { - "name": "report_refusal", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_report_refusal_actor": { - "name": "idx_report_refusal_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_refusal_occurred": { - "name": "idx_report_refusal_occurred", - "columns": [ - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.contributor_receipt": { - "name": "contributor_receipt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "version": { - "name": "version", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "contributors": { - "name": "contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "provenance": { - "name": "provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "reading": { - "name": "reading", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template_hash": { - "name": "template_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_id": { - "name": "contributor_receipt_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "crowd_record_id": { - "name": "crowd_record_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_sources": { - "name": "fused_sources", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_public": { - "name": "fused_public", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_source": { - "name": "idx_observation_latest_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "series_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_effective_brin": { - "name": "idx_observation_latest_effective_brin", - "columns": [ - { - "expression": "effective_from", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "brin", - "with": {} - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "crowd_record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"crowd_record_id\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "nullsNotDistinct": false, - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ] - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - }, - "idx_feature_rights_revoked": { - "name": "idx_feature_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"feature\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\" COLLATE \"C\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_rights_revoked": { - "name": "idx_offer_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"offer\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "tableTo": "offer", - "schemaTo": "conditions", - "columnsFrom": [ - "offer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_rights_revoked": { - "name": "idx_situation_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('none', 'minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_erasure": { - "name": "archive_erasure", - "schema": "conditions", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "applied_at": { - "name": "applied_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_file": { - "name": "archive_file", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "file_name": { - "name": "file_name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sha256": { - "name": "sha256", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "bytes": { - "name": "bytes", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "built_at": { - "name": "built_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "endorsed_by": { - "name": "endorsed_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "endorsement": { - "name": "endorsement", - "type": "bytea", - "primaryKey": false, - "notNull": false - }, - "endorsement_proof": { - "name": "endorsement_proof", - "type": "bytea", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_lapsed_copy": { - "name": "federation_lapsed_copy", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "lapsed_at": { - "name": "lapsed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_lapsed_copy_source": { - "name": "idx_federation_lapsed_copy_source", - "columns": [ - { - "expression": "peer_instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_lapsed_copy_record_class_record_id_pk": { - "name": "federation_lapsed_copy_record_class_record_id_pk", - "columns": [ - "record_class", - "record_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete','liveness')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_cursor": { - "name": "federation_peer_cursor", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "archive_built_at": { - "name": "archive_built_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "archive_landed_at": { - "name": "archive_landed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_key": { - "name": "federation_peer_key", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "anchor": { - "name": "anchor", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "learned_at": { - "name": "learned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_peer_key_peer_instance_id_key_id_pk": { - "name": "federation_peer_key_peer_instance_id_key_id_pk", - "columns": [ - "peer_instance_id", - "key_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_source_receipt": { - "name": "federation_source_receipt", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_received_at": { - "name": "last_received_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "liveness_at": { - "name": "liveness_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_source_receipt_peer_instance_id_source_id_pk": { - "name": "federation_source_receipt_peer_instance_id_source_id_pk", - "columns": [ - "peer_instance_id", - "source_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "uq_federation_subscription_target": { - "name": "uq_federation_subscription_target", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "delivery_mode", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "coalesce(\"inbox_url\", '')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"conditions\".\"federation_subscription\".\"delivery_mode\" <> 'sse'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.on_demand_fetch": { - "name": "on_demand_fetch", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "retry_at": { - "name": "retry_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "claimed_until": { - "name": "claimed_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "on_demand_fetch_source_id_cell_pk": { - "name": "on_demand_fetch_source_id_cell_pk", - "columns": [ - "source_id", - "cell" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "on_demand_fetch_status_enum": { - "name": "on_demand_fetch_status_enum", - "value": "\"conditions\".\"on_demand_fetch\".\"status\" IN ('pending','fresh','failed')" - } - }, - "isRLSEnabled": false - }, - "conditions.on_demand_quota": { - "name": "on_demand_quota", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "tokens": { - "name": "tokens", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "refilled_at": { - "name": "refilled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "day": { - "name": "day", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "day_count": { - "name": "day_count", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.public_license_policy": { - "name": "public_license_policy", - "schema": "conditions", - "columns": { - "license": { - "name": "license", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.smn_cap_message": { - "name": "smn_cap_message", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "identifier": { - "name": "identifier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "body": { - "name": "body", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "retain_until": { - "name": "retain_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "smn_cap_message_source_id_identifier_pk": { - "name": "smn_cap_message_source_id_identifier_pk", - "columns": [ - "source_id", - "identifier" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_shrink": { - "name": "source_shrink", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "since": { - "name": "since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "polls": { - "name": "polls", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "stated": { - "name": "stated", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "held": { - "name": "held", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "source_shrink_source_id_scope_pk": { - "name": "source_shrink_source_id_scope_pk", - "columns": [ - "source_id", - "scope" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_shrink_scope_enum": { - "name": "source_shrink_scope_enum", - "value": "\"conditions\".\"source_shrink\".\"scope\" IN ('series','records')" - } - }, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "source_published_at": { - "name": "source_published_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.oauth_grant": { - "name": "oauth_grant", - "schema": "conditions", - "columns": { - "grant_key": { - "name": "grant_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_issued_at": { - "name": "refresh_issued_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_expires_at": { - "name": "access_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "rejected_at": { - "name": "rejected_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "product": { - "name": "product", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "credit_name": { - "name": "credit_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_url": { - "name": "credit_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_notice": { - "name": "credit_notice", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "restricted": { - "name": "restricted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restricted_since": { - "name": "restricted_since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fusion_restricted": { - "name": "fusion_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "fusion_tier": { - "name": "fusion_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "fusion_licenses": { - "name": "fusion_licenses", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "federation_restricted": { - "name": "federation_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "federation_pending": { - "name": "federation_pending", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0095_snapshot.json b/packages/core/drizzle/meta/0095_snapshot.json deleted file mode 100644 index 94b6eb2c9..000000000 --- a/packages/core/drizzle/meta/0095_snapshot.json +++ /dev/null @@ -1,6388 +0,0 @@ -{ - "id": "cff03ec5-e068-43ee-a942-ae962c47d767", - "prevId": "aaddd309-92cd-4835-92d3-263fee55294a", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.report_refusal": { - "name": "report_refusal", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_report_refusal_actor": { - "name": "idx_report_refusal_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_refusal_occurred": { - "name": "idx_report_refusal_occurred", - "columns": [ - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.contributor_receipt": { - "name": "contributor_receipt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "version": { - "name": "version", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "contributors": { - "name": "contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "provenance": { - "name": "provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "reading": { - "name": "reading", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template_hash": { - "name": "template_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_id": { - "name": "contributor_receipt_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "crowd_record_id": { - "name": "crowd_record_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_sources": { - "name": "fused_sources", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_public": { - "name": "fused_public", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_source": { - "name": "idx_observation_latest_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "series_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_effective_brin": { - "name": "idx_observation_latest_effective_brin", - "columns": [ - { - "expression": "effective_from", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "brin", - "with": {} - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "crowd_record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"crowd_record_id\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "nullsNotDistinct": false, - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ] - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - }, - "idx_feature_rights_revoked": { - "name": "idx_feature_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"feature\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\" COLLATE \"C\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_rights_revoked": { - "name": "idx_offer_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"offer\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "tableTo": "offer", - "schemaTo": "conditions", - "columnsFrom": [ - "offer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_rights_revoked": { - "name": "idx_situation_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('none', 'minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_erasure": { - "name": "archive_erasure", - "schema": "conditions", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "applied_at": { - "name": "applied_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_file": { - "name": "archive_file", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "file_name": { - "name": "file_name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sha256": { - "name": "sha256", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "bytes": { - "name": "bytes", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "built_at": { - "name": "built_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "endorsed_by": { - "name": "endorsed_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "endorsement": { - "name": "endorsement", - "type": "bytea", - "primaryKey": false, - "notNull": false - }, - "endorsement_proof": { - "name": "endorsement_proof", - "type": "bytea", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_lapsed_copy": { - "name": "federation_lapsed_copy", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "lapsed_at": { - "name": "lapsed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_lapsed_copy_source": { - "name": "idx_federation_lapsed_copy_source", - "columns": [ - { - "expression": "peer_instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_lapsed_copy_record_class_record_id_pk": { - "name": "federation_lapsed_copy_record_class_record_id_pk", - "columns": [ - "record_class", - "record_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete','liveness')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_cursor": { - "name": "federation_peer_cursor", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "archive_built_at": { - "name": "archive_built_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "archive_landed_at": { - "name": "archive_landed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_key": { - "name": "federation_peer_key", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "anchor": { - "name": "anchor", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "learned_at": { - "name": "learned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_peer_key_peer_instance_id_key_id_pk": { - "name": "federation_peer_key_peer_instance_id_key_id_pk", - "columns": [ - "peer_instance_id", - "key_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_source_receipt": { - "name": "federation_source_receipt", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_received_at": { - "name": "last_received_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "liveness_at": { - "name": "liveness_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_source_receipt_peer_instance_id_source_id_pk": { - "name": "federation_source_receipt_peer_instance_id_source_id_pk", - "columns": [ - "peer_instance_id", - "source_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "uq_federation_subscription_target": { - "name": "uq_federation_subscription_target", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "delivery_mode", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "coalesce(\"inbox_url\", '')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"conditions\".\"federation_subscription\".\"delivery_mode\" <> 'sse'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.on_demand_fetch": { - "name": "on_demand_fetch", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "retry_at": { - "name": "retry_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "claimed_until": { - "name": "claimed_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "on_demand_fetch_source_id_cell_pk": { - "name": "on_demand_fetch_source_id_cell_pk", - "columns": [ - "source_id", - "cell" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "on_demand_fetch_status_enum": { - "name": "on_demand_fetch_status_enum", - "value": "\"conditions\".\"on_demand_fetch\".\"status\" IN ('pending','fresh','failed')" - } - }, - "isRLSEnabled": false - }, - "conditions.on_demand_quota": { - "name": "on_demand_quota", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "tokens": { - "name": "tokens", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "refilled_at": { - "name": "refilled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "day": { - "name": "day", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "day_count": { - "name": "day_count", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.public_license_policy": { - "name": "public_license_policy", - "schema": "conditions", - "columns": { - "license": { - "name": "license", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.smn_cap_decision": { - "name": "smn_cap_decision", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "decision": { - "name": "decision", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.smn_cap_message": { - "name": "smn_cap_message", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "identifier": { - "name": "identifier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "variant": { - "name": "variant", - "type": "text", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "encode(sha256(body), 'hex')", - "type": "stored" - } - }, - "retrieval": { - "name": "retrieval", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{\"legacy\":true}'::jsonb" - }, - "body": { - "name": "body", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "retain_until": { - "name": "retain_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "smn_cap_message_source_id_variant_pk": { - "name": "smn_cap_message_source_id_variant_pk", - "columns": [ - "source_id", - "variant" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_shrink": { - "name": "source_shrink", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "since": { - "name": "since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "polls": { - "name": "polls", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "stated": { - "name": "stated", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "held": { - "name": "held", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "source_shrink_source_id_scope_pk": { - "name": "source_shrink_source_id_scope_pk", - "columns": [ - "source_id", - "scope" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_shrink_scope_enum": { - "name": "source_shrink_scope_enum", - "value": "\"conditions\".\"source_shrink\".\"scope\" IN ('series','records')" - } - }, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "source_published_at": { - "name": "source_published_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.oauth_grant": { - "name": "oauth_grant", - "schema": "conditions", - "columns": { - "grant_key": { - "name": "grant_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_issued_at": { - "name": "refresh_issued_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_expires_at": { - "name": "access_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "rejected_at": { - "name": "rejected_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "product": { - "name": "product", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "credit_name": { - "name": "credit_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_url": { - "name": "credit_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_notice": { - "name": "credit_notice", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "restricted": { - "name": "restricted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restricted_since": { - "name": "restricted_since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fusion_restricted": { - "name": "fusion_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "fusion_tier": { - "name": "fusion_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "fusion_licenses": { - "name": "fusion_licenses", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "federation_restricted": { - "name": "federation_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "federation_pending": { - "name": "federation_pending", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0096_snapshot.json b/packages/core/drizzle/meta/0096_snapshot.json deleted file mode 100644 index 514e3daab..000000000 --- a/packages/core/drizzle/meta/0096_snapshot.json +++ /dev/null @@ -1,6445 +0,0 @@ -{ - "id": "35f158e2-2324-4ba5-8c94-20f56b1fbed0", - "prevId": "cff03ec5-e068-43ee-a942-ae962c47d767", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.report_refusal": { - "name": "report_refusal", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_report_refusal_actor": { - "name": "idx_report_refusal_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_refusal_occurred": { - "name": "idx_report_refusal_occurred", - "columns": [ - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.contributor_receipt": { - "name": "contributor_receipt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "version": { - "name": "version", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "contributors": { - "name": "contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "provenance": { - "name": "provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "reading": { - "name": "reading", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template_hash": { - "name": "template_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_id": { - "name": "contributor_receipt_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "crowd_record_id": { - "name": "crowd_record_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_sources": { - "name": "fused_sources", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_public": { - "name": "fused_public", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_source": { - "name": "idx_observation_latest_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "series_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_effective_brin": { - "name": "idx_observation_latest_effective_brin", - "columns": [ - { - "expression": "effective_from", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "brin", - "with": {} - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "crowd_record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"crowd_record_id\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "nullsNotDistinct": false, - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ] - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - }, - "idx_feature_rights_revoked": { - "name": "idx_feature_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"feature\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\" COLLATE \"C\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_rights_revoked": { - "name": "idx_offer_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"offer\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "tableTo": "offer", - "schemaTo": "conditions", - "columnsFrom": [ - "offer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_rights_revoked": { - "name": "idx_situation_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('none', 'minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_erasure": { - "name": "archive_erasure", - "schema": "conditions", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "applied_at": { - "name": "applied_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_file": { - "name": "archive_file", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "file_name": { - "name": "file_name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sha256": { - "name": "sha256", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "bytes": { - "name": "bytes", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "built_at": { - "name": "built_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "endorsed_by": { - "name": "endorsed_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "endorsement": { - "name": "endorsement", - "type": "bytea", - "primaryKey": false, - "notNull": false - }, - "endorsement_proof": { - "name": "endorsement_proof", - "type": "bytea", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_lapsed_copy": { - "name": "federation_lapsed_copy", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "lapsed_at": { - "name": "lapsed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_lapsed_copy_source": { - "name": "idx_federation_lapsed_copy_source", - "columns": [ - { - "expression": "peer_instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_lapsed_copy_record_class_record_id_pk": { - "name": "federation_lapsed_copy_record_class_record_id_pk", - "columns": [ - "record_class", - "record_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete','liveness')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_cursor": { - "name": "federation_peer_cursor", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "archive_built_at": { - "name": "archive_built_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "archive_landed_at": { - "name": "archive_landed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_key": { - "name": "federation_peer_key", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "anchor": { - "name": "anchor", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "learned_at": { - "name": "learned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_peer_key_peer_instance_id_key_id_pk": { - "name": "federation_peer_key_peer_instance_id_key_id_pk", - "columns": [ - "peer_instance_id", - "key_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_source_receipt": { - "name": "federation_source_receipt", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_received_at": { - "name": "last_received_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "liveness_at": { - "name": "liveness_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_source_receipt_peer_instance_id_source_id_pk": { - "name": "federation_source_receipt_peer_instance_id_source_id_pk", - "columns": [ - "peer_instance_id", - "source_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "uq_federation_subscription_target": { - "name": "uq_federation_subscription_target", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "delivery_mode", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "coalesce(\"inbox_url\", '')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"conditions\".\"federation_subscription\".\"delivery_mode\" <> 'sse'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.nsw_rfs_clock": { - "name": "nsw_rfs_clock", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "incident_id": { - "name": "incident_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sent": { - "name": "sent", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expiry": { - "name": "expiry", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "nsw_rfs_clock_source_id_incident_id_pk": { - "name": "nsw_rfs_clock_source_id_incident_id_pk", - "columns": [ - "source_id", - "incident_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.on_demand_fetch": { - "name": "on_demand_fetch", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "retry_at": { - "name": "retry_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "claimed_until": { - "name": "claimed_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "on_demand_fetch_source_id_cell_pk": { - "name": "on_demand_fetch_source_id_cell_pk", - "columns": [ - "source_id", - "cell" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "on_demand_fetch_status_enum": { - "name": "on_demand_fetch_status_enum", - "value": "\"conditions\".\"on_demand_fetch\".\"status\" IN ('pending','fresh','failed')" - } - }, - "isRLSEnabled": false - }, - "conditions.on_demand_quota": { - "name": "on_demand_quota", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "tokens": { - "name": "tokens", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "refilled_at": { - "name": "refilled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "day": { - "name": "day", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "day_count": { - "name": "day_count", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.public_license_policy": { - "name": "public_license_policy", - "schema": "conditions", - "columns": { - "license": { - "name": "license", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.smn_cap_decision": { - "name": "smn_cap_decision", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "decision": { - "name": "decision", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.smn_cap_message": { - "name": "smn_cap_message", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "identifier": { - "name": "identifier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "variant": { - "name": "variant", - "type": "text", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "encode(sha256(body), 'hex')", - "type": "stored" - } - }, - "retrieval": { - "name": "retrieval", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{\"legacy\":true}'::jsonb" - }, - "body": { - "name": "body", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "retain_until": { - "name": "retain_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "smn_cap_message_source_id_variant_pk": { - "name": "smn_cap_message_source_id_variant_pk", - "columns": [ - "source_id", - "variant" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_shrink": { - "name": "source_shrink", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "since": { - "name": "since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "polls": { - "name": "polls", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "stated": { - "name": "stated", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "held": { - "name": "held", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "source_shrink_source_id_scope_pk": { - "name": "source_shrink_source_id_scope_pk", - "columns": [ - "source_id", - "scope" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_shrink_scope_enum": { - "name": "source_shrink_scope_enum", - "value": "\"conditions\".\"source_shrink\".\"scope\" IN ('series','records')" - } - }, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "source_published_at": { - "name": "source_published_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.oauth_grant": { - "name": "oauth_grant", - "schema": "conditions", - "columns": { - "grant_key": { - "name": "grant_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_issued_at": { - "name": "refresh_issued_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_expires_at": { - "name": "access_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "rejected_at": { - "name": "rejected_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "product": { - "name": "product", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "credit_name": { - "name": "credit_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_url": { - "name": "credit_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_notice": { - "name": "credit_notice", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "restricted": { - "name": "restricted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restricted_since": { - "name": "restricted_since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fusion_restricted": { - "name": "fusion_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "fusion_tier": { - "name": "fusion_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "fusion_licenses": { - "name": "fusion_licenses", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "federation_restricted": { - "name": "federation_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "federation_pending": { - "name": "federation_pending", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0097_snapshot.json b/packages/core/drizzle/meta/0097_snapshot.json deleted file mode 100644 index 2e25ce0b4..000000000 --- a/packages/core/drizzle/meta/0097_snapshot.json +++ /dev/null @@ -1,6483 +0,0 @@ -{ - "id": "d6f4824e-cc6a-4e37-9f08-3d9c3b4bfbe9", - "prevId": "35f158e2-2324-4ba5-8c94-20f56b1fbed0", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.report_refusal": { - "name": "report_refusal", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_report_refusal_actor": { - "name": "idx_report_refusal_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_refusal_occurred": { - "name": "idx_report_refusal_occurred", - "columns": [ - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.contributor_receipt": { - "name": "contributor_receipt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "version": { - "name": "version", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "contributors": { - "name": "contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "provenance": { - "name": "provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "reading": { - "name": "reading", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template_hash": { - "name": "template_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_id": { - "name": "contributor_receipt_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "crowd_record_id": { - "name": "crowd_record_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_sources": { - "name": "fused_sources", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_public": { - "name": "fused_public", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_source": { - "name": "idx_observation_latest_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "series_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_effective_brin": { - "name": "idx_observation_latest_effective_brin", - "columns": [ - { - "expression": "effective_from", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "brin", - "with": {} - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "crowd_record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"crowd_record_id\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "nullsNotDistinct": false, - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ] - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - }, - "idx_feature_rights_revoked": { - "name": "idx_feature_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"feature\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\" COLLATE \"C\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_rights_revoked": { - "name": "idx_offer_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"offer\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "tableTo": "offer", - "schemaTo": "conditions", - "columnsFrom": [ - "offer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_rights_revoked": { - "name": "idx_situation_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('none', 'minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_erasure": { - "name": "archive_erasure", - "schema": "conditions", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "applied_at": { - "name": "applied_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_file": { - "name": "archive_file", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "file_name": { - "name": "file_name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sha256": { - "name": "sha256", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "bytes": { - "name": "bytes", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "built_at": { - "name": "built_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "endorsed_by": { - "name": "endorsed_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "endorsement": { - "name": "endorsement", - "type": "bytea", - "primaryKey": false, - "notNull": false - }, - "endorsement_proof": { - "name": "endorsement_proof", - "type": "bytea", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_lapsed_copy": { - "name": "federation_lapsed_copy", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "lapsed_at": { - "name": "lapsed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_lapsed_copy_source": { - "name": "idx_federation_lapsed_copy_source", - "columns": [ - { - "expression": "peer_instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_lapsed_copy_record_class_record_id_pk": { - "name": "federation_lapsed_copy_record_class_record_id_pk", - "columns": [ - "record_class", - "record_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete','liveness')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_cursor": { - "name": "federation_peer_cursor", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "archive_built_at": { - "name": "archive_built_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "archive_landed_at": { - "name": "archive_landed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_key": { - "name": "federation_peer_key", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "anchor": { - "name": "anchor", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "learned_at": { - "name": "learned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_peer_key_peer_instance_id_key_id_pk": { - "name": "federation_peer_key_peer_instance_id_key_id_pk", - "columns": [ - "peer_instance_id", - "key_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_source_receipt": { - "name": "federation_source_receipt", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_received_at": { - "name": "last_received_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "liveness_at": { - "name": "liveness_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_source_receipt_peer_instance_id_source_id_pk": { - "name": "federation_source_receipt_peer_instance_id_source_id_pk", - "columns": [ - "peer_instance_id", - "source_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "uq_federation_subscription_target": { - "name": "uq_federation_subscription_target", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "delivery_mode", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "coalesce(\"inbox_url\", '')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"conditions\".\"federation_subscription\".\"delivery_mode\" <> 'sse'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.geonet_coverage": { - "name": "geonet_coverage", - "schema": "conditions", - "columns": { - "revisions": { - "name": "revisions", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "covered_from": { - "name": "covered_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "covered_until": { - "name": "covered_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.nsw_rfs_clock": { - "name": "nsw_rfs_clock", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "incident_id": { - "name": "incident_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sent": { - "name": "sent", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expiry": { - "name": "expiry", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "nsw_rfs_clock_source_id_incident_id_pk": { - "name": "nsw_rfs_clock_source_id_incident_id_pk", - "columns": [ - "source_id", - "incident_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.on_demand_fetch": { - "name": "on_demand_fetch", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "retry_at": { - "name": "retry_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "claimed_until": { - "name": "claimed_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "on_demand_fetch_source_id_cell_pk": { - "name": "on_demand_fetch_source_id_cell_pk", - "columns": [ - "source_id", - "cell" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "on_demand_fetch_status_enum": { - "name": "on_demand_fetch_status_enum", - "value": "\"conditions\".\"on_demand_fetch\".\"status\" IN ('pending','fresh','failed')" - } - }, - "isRLSEnabled": false - }, - "conditions.on_demand_quota": { - "name": "on_demand_quota", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "tokens": { - "name": "tokens", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "refilled_at": { - "name": "refilled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "day": { - "name": "day", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "day_count": { - "name": "day_count", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.public_license_policy": { - "name": "public_license_policy", - "schema": "conditions", - "columns": { - "license": { - "name": "license", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.smn_cap_decision": { - "name": "smn_cap_decision", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "decision": { - "name": "decision", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.smn_cap_message": { - "name": "smn_cap_message", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "identifier": { - "name": "identifier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "variant": { - "name": "variant", - "type": "text", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "encode(sha256(body), 'hex')", - "type": "stored" - } - }, - "retrieval": { - "name": "retrieval", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{\"legacy\":true}'::jsonb" - }, - "body": { - "name": "body", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "retain_until": { - "name": "retain_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "smn_cap_message_source_id_variant_pk": { - "name": "smn_cap_message_source_id_variant_pk", - "columns": [ - "source_id", - "variant" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_shrink": { - "name": "source_shrink", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "since": { - "name": "since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "polls": { - "name": "polls", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "stated": { - "name": "stated", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "held": { - "name": "held", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "source_shrink_source_id_scope_pk": { - "name": "source_shrink_source_id_scope_pk", - "columns": [ - "source_id", - "scope" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_shrink_scope_enum": { - "name": "source_shrink_scope_enum", - "value": "\"conditions\".\"source_shrink\".\"scope\" IN ('series','records')" - } - }, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "source_published_at": { - "name": "source_published_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.oauth_grant": { - "name": "oauth_grant", - "schema": "conditions", - "columns": { - "grant_key": { - "name": "grant_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_issued_at": { - "name": "refresh_issued_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_expires_at": { - "name": "access_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "rejected_at": { - "name": "rejected_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "product": { - "name": "product", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "credit_name": { - "name": "credit_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_url": { - "name": "credit_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_notice": { - "name": "credit_notice", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "restricted": { - "name": "restricted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restricted_since": { - "name": "restricted_since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fusion_restricted": { - "name": "fusion_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "fusion_tier": { - "name": "fusion_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "fusion_licenses": { - "name": "fusion_licenses", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "federation_restricted": { - "name": "federation_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "federation_pending": { - "name": "federation_pending", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} diff --git a/packages/core/drizzle/meta/0098_snapshot.json b/packages/core/drizzle/meta/0098_snapshot.json deleted file mode 100644 index 300e8c6c5..000000000 --- a/packages/core/drizzle/meta/0098_snapshot.json +++ /dev/null @@ -1,6547 +0,0 @@ -{ - "id": "4bc1aa2a-cd9e-486d-ae64-0eb2df8a97d2", - "prevId": "d6f4824e-cc6a-4e37-9f08-3d9c3b4bfbe9", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.report_refusal": { - "name": "report_refusal", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_report_refusal_actor": { - "name": "idx_report_refusal_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_refusal_occurred": { - "name": "idx_report_refusal_occurred", - "columns": [ - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.contributor_receipt": { - "name": "contributor_receipt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "version": { - "name": "version", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "contributors": { - "name": "contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "provenance": { - "name": "provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "reading": { - "name": "reading", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template_hash": { - "name": "template_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_id": { - "name": "contributor_receipt_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "crowd_record_id": { - "name": "crowd_record_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_sources": { - "name": "fused_sources", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_public": { - "name": "fused_public", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_source": { - "name": "idx_observation_latest_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "series_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_effective_brin": { - "name": "idx_observation_latest_effective_brin", - "columns": [ - { - "expression": "effective_from", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "brin", - "with": {} - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "crowd_record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"crowd_record_id\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "nullsNotDistinct": false, - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ] - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - }, - "idx_feature_rights_revoked": { - "name": "idx_feature_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"feature\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\" COLLATE \"C\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_rights_revoked": { - "name": "idx_offer_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"offer\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "tableTo": "offer", - "schemaTo": "conditions", - "columnsFrom": [ - "offer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_rights_revoked": { - "name": "idx_situation_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('none', 'minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_erasure": { - "name": "archive_erasure", - "schema": "conditions", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "applied_at": { - "name": "applied_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_file": { - "name": "archive_file", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "file_name": { - "name": "file_name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sha256": { - "name": "sha256", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "bytes": { - "name": "bytes", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "built_at": { - "name": "built_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "endorsed_by": { - "name": "endorsed_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "endorsement": { - "name": "endorsement", - "type": "bytea", - "primaryKey": false, - "notNull": false - }, - "endorsement_proof": { - "name": "endorsement_proof", - "type": "bytea", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_lapsed_copy": { - "name": "federation_lapsed_copy", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "lapsed_at": { - "name": "lapsed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_lapsed_copy_source": { - "name": "idx_federation_lapsed_copy_source", - "columns": [ - { - "expression": "peer_instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_lapsed_copy_record_class_record_id_pk": { - "name": "federation_lapsed_copy_record_class_record_id_pk", - "columns": [ - "record_class", - "record_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete','liveness')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_cursor": { - "name": "federation_peer_cursor", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "archive_built_at": { - "name": "archive_built_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "archive_landed_at": { - "name": "archive_landed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_key": { - "name": "federation_peer_key", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "anchor": { - "name": "anchor", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "learned_at": { - "name": "learned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_peer_key_peer_instance_id_key_id_pk": { - "name": "federation_peer_key_peer_instance_id_key_id_pk", - "columns": [ - "peer_instance_id", - "key_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_source_receipt": { - "name": "federation_source_receipt", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_received_at": { - "name": "last_received_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "liveness_at": { - "name": "liveness_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_source_receipt_peer_instance_id_source_id_pk": { - "name": "federation_source_receipt_peer_instance_id_source_id_pk", - "columns": [ - "peer_instance_id", - "source_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "uq_federation_subscription_target": { - "name": "uq_federation_subscription_target", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "delivery_mode", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "coalesce(\"inbox_url\", '')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"conditions\".\"federation_subscription\".\"delivery_mode\" <> 'sse'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.geonet_coverage": { - "name": "geonet_coverage", - "schema": "conditions", - "columns": { - "revisions": { - "name": "revisions", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "covered_from": { - "name": "covered_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "covered_until": { - "name": "covered_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.nsw_rfs_clock": { - "name": "nsw_rfs_clock", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "incident_id": { - "name": "incident_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sent": { - "name": "sent", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expiry": { - "name": "expiry", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "nsw_rfs_clock_source_id_incident_id_pk": { - "name": "nsw_rfs_clock_source_id_incident_id_pk", - "columns": [ - "source_id", - "incident_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_revision": { - "name": "observation_revision", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "measured_at": { - "name": "measured_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "rank": { - "name": "rank", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "suppressed": { - "name": "suppressed", - "type": "boolean", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "observation_revision_source_id_feature_id_property_pk": { - "name": "observation_revision_source_id_feature_id_property_pk", - "columns": [ - "source_id", - "feature_id", - "property" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.on_demand_fetch": { - "name": "on_demand_fetch", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "retry_at": { - "name": "retry_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "claimed_until": { - "name": "claimed_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "on_demand_fetch_source_id_cell_pk": { - "name": "on_demand_fetch_source_id_cell_pk", - "columns": [ - "source_id", - "cell" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "on_demand_fetch_status_enum": { - "name": "on_demand_fetch_status_enum", - "value": "\"conditions\".\"on_demand_fetch\".\"status\" IN ('pending','fresh','failed')" - } - }, - "isRLSEnabled": false - }, - "conditions.on_demand_quota": { - "name": "on_demand_quota", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "tokens": { - "name": "tokens", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "refilled_at": { - "name": "refilled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "day": { - "name": "day", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "day_count": { - "name": "day_count", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.public_license_policy": { - "name": "public_license_policy", - "schema": "conditions", - "columns": { - "license": { - "name": "license", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.smn_cap_decision": { - "name": "smn_cap_decision", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "decision": { - "name": "decision", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.smn_cap_message": { - "name": "smn_cap_message", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "identifier": { - "name": "identifier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "variant": { - "name": "variant", - "type": "text", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "encode(sha256(body), 'hex')", - "type": "stored" - } - }, - "retrieval": { - "name": "retrieval", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{\"legacy\":true}'::jsonb" - }, - "body": { - "name": "body", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "retain_until": { - "name": "retain_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "smn_cap_message_source_id_variant_pk": { - "name": "smn_cap_message_source_id_variant_pk", - "columns": [ - "source_id", - "variant" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_shrink": { - "name": "source_shrink", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "since": { - "name": "since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "polls": { - "name": "polls", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "stated": { - "name": "stated", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "held": { - "name": "held", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "source_shrink_source_id_scope_pk": { - "name": "source_shrink_source_id_scope_pk", - "columns": [ - "source_id", - "scope" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_shrink_scope_enum": { - "name": "source_shrink_scope_enum", - "value": "\"conditions\".\"source_shrink\".\"scope\" IN ('series','records')" - } - }, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "source_published_at": { - "name": "source_published_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.oauth_grant": { - "name": "oauth_grant", - "schema": "conditions", - "columns": { - "grant_key": { - "name": "grant_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_issued_at": { - "name": "refresh_issued_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_expires_at": { - "name": "access_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "rejected_at": { - "name": "rejected_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "product": { - "name": "product", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "credit_name": { - "name": "credit_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_url": { - "name": "credit_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_notice": { - "name": "credit_notice", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "restricted": { - "name": "restricted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restricted_since": { - "name": "restricted_since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fusion_restricted": { - "name": "fusion_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "fusion_tier": { - "name": "fusion_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "fusion_licenses": { - "name": "fusion_licenses", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "federation_restricted": { - "name": "federation_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "federation_pending": { - "name": "federation_pending", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0099_snapshot.json b/packages/core/drizzle/meta/0099_snapshot.json deleted file mode 100644 index 26dfde723..000000000 --- a/packages/core/drizzle/meta/0099_snapshot.json +++ /dev/null @@ -1,6624 +0,0 @@ -{ - "id": "d22e18e0-2087-497c-acca-bc473916a82d", - "prevId": "4bc1aa2a-cd9e-486d-ae64-0eb2df8a97d2", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.archive_erasure": { - "name": "archive_erasure", - "schema": "conditions", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "applied_at": { - "name": "applied_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_file": { - "name": "archive_file", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "file_name": { - "name": "file_name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sha256": { - "name": "sha256", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "bytes": { - "name": "bytes", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "built_at": { - "name": "built_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "endorsed_by": { - "name": "endorsed_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "endorsement": { - "name": "endorsement", - "type": "bytea", - "primaryKey": false, - "notNull": false - }, - "endorsement_proof": { - "name": "endorsement_proof", - "type": "bytea", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_lapsed_copy": { - "name": "federation_lapsed_copy", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "lapsed_at": { - "name": "lapsed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_lapsed_copy_source": { - "name": "idx_federation_lapsed_copy_source", - "columns": [ - { - "expression": "peer_instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_lapsed_copy_record_class_record_id_pk": { - "name": "federation_lapsed_copy_record_class_record_id_pk", - "columns": [ - "record_class", - "record_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete','liveness')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_cursor": { - "name": "federation_peer_cursor", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "archive_built_at": { - "name": "archive_built_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "archive_landed_at": { - "name": "archive_landed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_key": { - "name": "federation_peer_key", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "anchor": { - "name": "anchor", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "learned_at": { - "name": "learned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_peer_key_peer_instance_id_key_id_pk": { - "name": "federation_peer_key_peer_instance_id_key_id_pk", - "columns": [ - "peer_instance_id", - "key_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_source_receipt": { - "name": "federation_source_receipt", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_received_at": { - "name": "last_received_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "liveness_at": { - "name": "liveness_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_source_receipt_peer_instance_id_source_id_pk": { - "name": "federation_source_receipt_peer_instance_id_source_id_pk", - "columns": [ - "peer_instance_id", - "source_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "uq_federation_subscription_target": { - "name": "uq_federation_subscription_target", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "delivery_mode", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "coalesce(\"inbox_url\", '')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"conditions\".\"federation_subscription\".\"delivery_mode\" <> 'sse'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.geonet_coverage": { - "name": "geonet_coverage", - "schema": "conditions", - "columns": { - "revisions": { - "name": "revisions", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "covered_from": { - "name": "covered_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "covered_until": { - "name": "covered_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.nsw_rfs_clock": { - "name": "nsw_rfs_clock", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "incident_id": { - "name": "incident_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sent": { - "name": "sent", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expiry": { - "name": "expiry", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "nsw_rfs_clock_source_id_incident_id_pk": { - "name": "nsw_rfs_clock_source_id_incident_id_pk", - "columns": [ - "source_id", - "incident_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_revision": { - "name": "observation_revision", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "measured_at": { - "name": "measured_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "rank": { - "name": "rank", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "suppressed": { - "name": "suppressed", - "type": "boolean", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "observation_revision_source_id_feature_id_property_pk": { - "name": "observation_revision_source_id_feature_id_property_pk", - "columns": [ - "source_id", - "feature_id", - "property" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.on_demand_fetch": { - "name": "on_demand_fetch", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "retry_at": { - "name": "retry_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "claimed_until": { - "name": "claimed_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "on_demand_fetch_source_id_cell_pk": { - "name": "on_demand_fetch_source_id_cell_pk", - "columns": [ - "source_id", - "cell" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "on_demand_fetch_status_enum": { - "name": "on_demand_fetch_status_enum", - "value": "\"conditions\".\"on_demand_fetch\".\"status\" IN ('pending','fresh','failed')" - } - }, - "isRLSEnabled": false - }, - "conditions.on_demand_quota": { - "name": "on_demand_quota", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "tokens": { - "name": "tokens", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "refilled_at": { - "name": "refilled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "day": { - "name": "day", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "day_count": { - "name": "day_count", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.public_license_policy": { - "name": "public_license_policy", - "schema": "conditions", - "columns": { - "license": { - "name": "license", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.smn_cap_decision": { - "name": "smn_cap_decision", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "decision": { - "name": "decision", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.smn_cap_message": { - "name": "smn_cap_message", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "identifier": { - "name": "identifier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "variant": { - "name": "variant", - "type": "text", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "encode(sha256(body), 'hex')", - "type": "stored" - } - }, - "retrieval": { - "name": "retrieval", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{\"legacy\":true}'::jsonb" - }, - "body": { - "name": "body", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "retain_until": { - "name": "retain_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "smn_cap_message_source_id_variant_pk": { - "name": "smn_cap_message_source_id_variant_pk", - "columns": [ - "source_id", - "variant" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_shrink": { - "name": "source_shrink", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "since": { - "name": "since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "polls": { - "name": "polls", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "stated": { - "name": "stated", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "held": { - "name": "held", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "source_shrink_source_id_scope_pk": { - "name": "source_shrink_source_id_scope_pk", - "columns": [ - "source_id", - "scope" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_shrink_scope_enum": { - "name": "source_shrink_scope_enum", - "value": "\"conditions\".\"source_shrink\".\"scope\" IN ('series','records')" - } - }, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "source_published_at": { - "name": "source_published_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.report_refusal": { - "name": "report_refusal", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_report_refusal_actor": { - "name": "idx_report_refusal_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_refusal_occurred": { - "name": "idx_report_refusal_occurred", - "columns": [ - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.oauth_grant": { - "name": "oauth_grant", - "schema": "conditions", - "columns": { - "grant_key": { - "name": "grant_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_issued_at": { - "name": "refresh_issued_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_expires_at": { - "name": "access_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "rejected_at": { - "name": "rejected_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "product": { - "name": "product", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "credit_name": { - "name": "credit_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_url": { - "name": "credit_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_notice": { - "name": "credit_notice", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "restricted": { - "name": "restricted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restricted_since": { - "name": "restricted_since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fusion_restricted": { - "name": "fusion_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "fusion_tier": { - "name": "fusion_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "fusion_licenses": { - "name": "fusion_licenses", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "federation_restricted": { - "name": "federation_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "federation_pending": { - "name": "federation_pending", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - } - }, - "isRLSEnabled": false - }, - "conditions.contributor_receipt": { - "name": "contributor_receipt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "version": { - "name": "version", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "contributors": { - "name": "contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "provenance": { - "name": "provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "reading": { - "name": "reading", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template_hash": { - "name": "template_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_id": { - "name": "contributor_receipt_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "crowd_record_id": { - "name": "crowd_record_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_sources": { - "name": "fused_sources", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_public": { - "name": "fused_public", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_source": { - "name": "idx_observation_latest_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "series_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_effective_brin": { - "name": "idx_observation_latest_effective_brin", - "columns": [ - { - "expression": "effective_from", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "brin", - "with": {} - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "crowd_record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"crowd_record_id\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "nullsNotDistinct": false, - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ] - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - }, - "idx_feature_rights_revoked": { - "name": "idx_feature_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"feature\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\" COLLATE \"C\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_rights_revoked": { - "name": "idx_offer_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"offer\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "tableTo": "offer", - "schemaTo": "conditions", - "columnsFrom": [ - "offer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_rights_revoked": { - "name": "idx_situation_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('none', 'minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.jma_budget": { - "name": "jma_budget", - "schema": "conditions", - "columns": { - "egress": { - "name": "egress", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "day": { - "name": "day", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "used": { - "name": "used", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "reserved": { - "name": "reserved", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "jma_budget_egress_day_pk": { - "name": "jma_budget_egress_day_pk", - "columns": [ - "egress", - "day" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "jma_budget_nonnegative": { - "name": "jma_budget_nonnegative", - "value": "\"conditions\".\"jma_budget\".\"used\" >= 0 AND \"conditions\".\"jma_budget\".\"reserved\" >= 0" - } - }, - "isRLSEnabled": false - }, - "conditions.jma_download": { - "name": "jma_download", - "schema": "conditions", - "columns": { - "url": { - "name": "url", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0100_snapshot.json b/packages/core/drizzle/meta/0100_snapshot.json deleted file mode 100644 index 49fc527e5..000000000 --- a/packages/core/drizzle/meta/0100_snapshot.json +++ /dev/null @@ -1,6649 +0,0 @@ -{ - "id": "825392d6-6d98-45e1-a9b9-602f6b51a00d", - "prevId": "d22e18e0-2087-497c-acca-bc473916a82d", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.archive_erasure": { - "name": "archive_erasure", - "schema": "conditions", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "applied_at": { - "name": "applied_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_file": { - "name": "archive_file", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "file_name": { - "name": "file_name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sha256": { - "name": "sha256", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "bytes": { - "name": "bytes", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "built_at": { - "name": "built_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "endorsed_by": { - "name": "endorsed_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "endorsement": { - "name": "endorsement", - "type": "bytea", - "primaryKey": false, - "notNull": false - }, - "endorsement_proof": { - "name": "endorsement_proof", - "type": "bytea", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_lapsed_copy": { - "name": "federation_lapsed_copy", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "lapsed_at": { - "name": "lapsed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_lapsed_copy_source": { - "name": "idx_federation_lapsed_copy_source", - "columns": [ - { - "expression": "peer_instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_lapsed_copy_record_class_record_id_pk": { - "name": "federation_lapsed_copy_record_class_record_id_pk", - "columns": [ - "record_class", - "record_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete','liveness')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_cursor": { - "name": "federation_peer_cursor", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "archive_built_at": { - "name": "archive_built_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "archive_landed_at": { - "name": "archive_landed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_key": { - "name": "federation_peer_key", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "anchor": { - "name": "anchor", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "learned_at": { - "name": "learned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_peer_key_peer_instance_id_key_id_pk": { - "name": "federation_peer_key_peer_instance_id_key_id_pk", - "columns": [ - "peer_instance_id", - "key_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_source_receipt": { - "name": "federation_source_receipt", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_received_at": { - "name": "last_received_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "liveness_at": { - "name": "liveness_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_source_receipt_peer_instance_id_source_id_pk": { - "name": "federation_source_receipt_peer_instance_id_source_id_pk", - "columns": [ - "peer_instance_id", - "source_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "uq_federation_subscription_target": { - "name": "uq_federation_subscription_target", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "delivery_mode", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "coalesce(\"inbox_url\", '')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"conditions\".\"federation_subscription\".\"delivery_mode\" <> 'sse'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.geonet_coverage": { - "name": "geonet_coverage", - "schema": "conditions", - "columns": { - "revisions": { - "name": "revisions", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "covered_from": { - "name": "covered_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "covered_until": { - "name": "covered_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.nsw_rfs_clock": { - "name": "nsw_rfs_clock", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "incident_id": { - "name": "incident_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sent": { - "name": "sent", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expiry": { - "name": "expiry", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "nsw_rfs_clock_source_id_incident_id_pk": { - "name": "nsw_rfs_clock_source_id_incident_id_pk", - "columns": [ - "source_id", - "incident_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_revision": { - "name": "observation_revision", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "measured_at": { - "name": "measured_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "rank": { - "name": "rank", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "suppressed": { - "name": "suppressed", - "type": "boolean", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "observation_revision_source_id_feature_id_property_pk": { - "name": "observation_revision_source_id_feature_id_property_pk", - "columns": [ - "source_id", - "feature_id", - "property" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.on_demand_fetch": { - "name": "on_demand_fetch", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "retry_at": { - "name": "retry_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "claimed_until": { - "name": "claimed_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "on_demand_fetch_source_id_cell_pk": { - "name": "on_demand_fetch_source_id_cell_pk", - "columns": [ - "source_id", - "cell" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "on_demand_fetch_status_enum": { - "name": "on_demand_fetch_status_enum", - "value": "\"conditions\".\"on_demand_fetch\".\"status\" IN ('pending','fresh','failed')" - } - }, - "isRLSEnabled": false - }, - "conditions.on_demand_quota": { - "name": "on_demand_quota", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "tokens": { - "name": "tokens", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "refilled_at": { - "name": "refilled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "day": { - "name": "day", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "day_count": { - "name": "day_count", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.public_license_policy": { - "name": "public_license_policy", - "schema": "conditions", - "columns": { - "license": { - "name": "license", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.smn_cap_decision": { - "name": "smn_cap_decision", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "decision": { - "name": "decision", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.smn_cap_message": { - "name": "smn_cap_message", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "identifier": { - "name": "identifier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "variant": { - "name": "variant", - "type": "text", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "encode(sha256(body), 'hex')", - "type": "stored" - } - }, - "retrieval": { - "name": "retrieval", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{\"legacy\":true}'::jsonb" - }, - "body": { - "name": "body", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "retain_until": { - "name": "retain_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "smn_cap_message_source_id_variant_pk": { - "name": "smn_cap_message_source_id_variant_pk", - "columns": [ - "source_id", - "variant" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_shrink": { - "name": "source_shrink", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "since": { - "name": "since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "polls": { - "name": "polls", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "stated": { - "name": "stated", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "held": { - "name": "held", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "source_shrink_source_id_scope_pk": { - "name": "source_shrink_source_id_scope_pk", - "columns": [ - "source_id", - "scope" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_shrink_scope_enum": { - "name": "source_shrink_scope_enum", - "value": "\"conditions\".\"source_shrink\".\"scope\" IN ('series','records')" - } - }, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "source_published_at": { - "name": "source_published_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.report_refusal": { - "name": "report_refusal", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_report_refusal_actor": { - "name": "idx_report_refusal_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_refusal_occurred": { - "name": "idx_report_refusal_occurred", - "columns": [ - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.oauth_grant": { - "name": "oauth_grant", - "schema": "conditions", - "columns": { - "grant_key": { - "name": "grant_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_issued_at": { - "name": "refresh_issued_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_expires_at": { - "name": "access_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "rejected_at": { - "name": "rejected_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "product": { - "name": "product", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "credit_name": { - "name": "credit_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_url": { - "name": "credit_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_notice": { - "name": "credit_notice", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "restricted": { - "name": "restricted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restricted_since": { - "name": "restricted_since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fusion_restricted": { - "name": "fusion_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "fusion_tier": { - "name": "fusion_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "fusion_licenses": { - "name": "fusion_licenses", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "federation_restricted": { - "name": "federation_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "federation_pending": { - "name": "federation_pending", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - } - }, - "isRLSEnabled": false - }, - "conditions.contributor_receipt": { - "name": "contributor_receipt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "version": { - "name": "version", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "contributors": { - "name": "contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "provenance": { - "name": "provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "reading": { - "name": "reading", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template_hash": { - "name": "template_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_id": { - "name": "contributor_receipt_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "crowd_record_id": { - "name": "crowd_record_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_sources": { - "name": "fused_sources", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_public": { - "name": "fused_public", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_source": { - "name": "idx_observation_latest_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "series_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_effective_brin": { - "name": "idx_observation_latest_effective_brin", - "columns": [ - { - "expression": "effective_from", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "brin", - "with": {} - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "crowd_record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"crowd_record_id\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "nullsNotDistinct": false, - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ] - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - }, - "idx_feature_rights_revoked": { - "name": "idx_feature_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"feature\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\" COLLATE \"C\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_rights_revoked": { - "name": "idx_offer_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"offer\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "tableTo": "offer", - "schemaTo": "conditions", - "columnsFrom": [ - "offer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_rights_revoked": { - "name": "idx_situation_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('none', 'minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.jma_budget": { - "name": "jma_budget", - "schema": "conditions", - "columns": { - "egress": { - "name": "egress", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "day": { - "name": "day", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "used": { - "name": "used", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "reserved": { - "name": "reserved", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "jma_budget_egress_day_pk": { - "name": "jma_budget_egress_day_pk", - "columns": [ - "egress", - "day" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "jma_budget_nonnegative": { - "name": "jma_budget_nonnegative", - "value": "\"conditions\".\"jma_budget\".\"used\" >= 0 AND \"conditions\".\"jma_budget\".\"reserved\" >= 0" - } - }, - "isRLSEnabled": false - }, - "conditions.jma_download": { - "name": "jma_download", - "schema": "conditions", - "columns": { - "url": { - "name": "url", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.jma_state": { - "name": "jma_state", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0101_snapshot.json b/packages/core/drizzle/meta/0101_snapshot.json deleted file mode 100644 index 673c3e616..000000000 --- a/packages/core/drizzle/meta/0101_snapshot.json +++ /dev/null @@ -1,6710 +0,0 @@ -{ - "id": "a8f63ed8-cffc-4ad6-a8b0-3dd7b6e5d672", - "prevId": "825392d6-6d98-45e1-a9b9-602f6b51a00d", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.report_refusal": { - "name": "report_refusal", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_report_refusal_actor": { - "name": "idx_report_refusal_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_refusal_occurred": { - "name": "idx_report_refusal_occurred", - "columns": [ - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.jma_budget": { - "name": "jma_budget", - "schema": "conditions", - "columns": { - "egress": { - "name": "egress", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "day": { - "name": "day", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "used": { - "name": "used", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "reserved": { - "name": "reserved", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "jma_budget_egress_day_pk": { - "name": "jma_budget_egress_day_pk", - "columns": [ - "egress", - "day" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "jma_budget_nonnegative": { - "name": "jma_budget_nonnegative", - "value": "\"conditions\".\"jma_budget\".\"used\" >= 0 AND \"conditions\".\"jma_budget\".\"reserved\" >= 0" - } - }, - "isRLSEnabled": false - }, - "conditions.jma_download": { - "name": "jma_download", - "schema": "conditions", - "columns": { - "url": { - "name": "url", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.jma_state": { - "name": "jma_state", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.contributor_receipt": { - "name": "contributor_receipt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "version": { - "name": "version", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "contributors": { - "name": "contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "provenance": { - "name": "provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "reading": { - "name": "reading", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template_hash": { - "name": "template_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_id": { - "name": "contributor_receipt_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "crowd_record_id": { - "name": "crowd_record_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_sources": { - "name": "fused_sources", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_public": { - "name": "fused_public", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_source": { - "name": "idx_observation_latest_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "series_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_effective_brin": { - "name": "idx_observation_latest_effective_brin", - "columns": [ - { - "expression": "effective_from", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "brin", - "with": {} - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "crowd_record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"crowd_record_id\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "nullsNotDistinct": false, - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ] - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - }, - "idx_feature_rights_revoked": { - "name": "idx_feature_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"feature\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\" COLLATE \"C\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_rights_revoked": { - "name": "idx_offer_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"offer\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "tableTo": "offer", - "schemaTo": "conditions", - "columnsFrom": [ - "offer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_rights_revoked": { - "name": "idx_situation_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('none', 'minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_erasure": { - "name": "archive_erasure", - "schema": "conditions", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "applied_at": { - "name": "applied_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_file": { - "name": "archive_file", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "file_name": { - "name": "file_name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sha256": { - "name": "sha256", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "bytes": { - "name": "bytes", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "built_at": { - "name": "built_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "endorsed_by": { - "name": "endorsed_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "endorsement": { - "name": "endorsement", - "type": "bytea", - "primaryKey": false, - "notNull": false - }, - "endorsement_proof": { - "name": "endorsement_proof", - "type": "bytea", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_journal": { - "name": "federation_journal", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "epoch": { - "name": "epoch", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "started_at": { - "name": "started_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_xid": { - "name": "seen_xid", - "type": "xid8", - "primaryKey": false, - "notNull": true - }, - "timeline_id": { - "name": "timeline_id", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_journal_single_row": { - "name": "federation_journal_single_row", - "value": "\"conditions\".\"federation_journal\".\"singleton\"" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_lapsed_copy": { - "name": "federation_lapsed_copy", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "lapsed_at": { - "name": "lapsed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_lapsed_copy_source": { - "name": "idx_federation_lapsed_copy_source", - "columns": [ - { - "expression": "peer_instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_lapsed_copy_record_class_record_id_pk": { - "name": "federation_lapsed_copy_record_class_record_id_pk", - "columns": [ - "record_class", - "record_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete','liveness')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_cursor": { - "name": "federation_peer_cursor", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "archive_built_at": { - "name": "archive_built_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "archive_landed_at": { - "name": "archive_landed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "journal_epoch": { - "name": "journal_epoch", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor_reset_at": { - "name": "cursor_reset_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_key": { - "name": "federation_peer_key", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "anchor": { - "name": "anchor", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "learned_at": { - "name": "learned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_peer_key_peer_instance_id_key_id_pk": { - "name": "federation_peer_key_peer_instance_id_key_id_pk", - "columns": [ - "peer_instance_id", - "key_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_source_receipt": { - "name": "federation_source_receipt", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_received_at": { - "name": "last_received_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "liveness_at": { - "name": "liveness_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_source_receipt_peer_instance_id_source_id_pk": { - "name": "federation_source_receipt_peer_instance_id_source_id_pk", - "columns": [ - "peer_instance_id", - "source_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "uq_federation_subscription_target": { - "name": "uq_federation_subscription_target", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "delivery_mode", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "coalesce(\"inbox_url\", '')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"conditions\".\"federation_subscription\".\"delivery_mode\" <> 'sse'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.geonet_coverage": { - "name": "geonet_coverage", - "schema": "conditions", - "columns": { - "revisions": { - "name": "revisions", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "covered_from": { - "name": "covered_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "covered_until": { - "name": "covered_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.nsw_rfs_clock": { - "name": "nsw_rfs_clock", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "incident_id": { - "name": "incident_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sent": { - "name": "sent", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expiry": { - "name": "expiry", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "nsw_rfs_clock_source_id_incident_id_pk": { - "name": "nsw_rfs_clock_source_id_incident_id_pk", - "columns": [ - "source_id", - "incident_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_revision": { - "name": "observation_revision", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "measured_at": { - "name": "measured_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "rank": { - "name": "rank", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "suppressed": { - "name": "suppressed", - "type": "boolean", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "observation_revision_source_id_feature_id_property_pk": { - "name": "observation_revision_source_id_feature_id_property_pk", - "columns": [ - "source_id", - "feature_id", - "property" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.on_demand_fetch": { - "name": "on_demand_fetch", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "retry_at": { - "name": "retry_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "claimed_until": { - "name": "claimed_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "on_demand_fetch_source_id_cell_pk": { - "name": "on_demand_fetch_source_id_cell_pk", - "columns": [ - "source_id", - "cell" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "on_demand_fetch_status_enum": { - "name": "on_demand_fetch_status_enum", - "value": "\"conditions\".\"on_demand_fetch\".\"status\" IN ('pending','fresh','failed')" - } - }, - "isRLSEnabled": false - }, - "conditions.on_demand_quota": { - "name": "on_demand_quota", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "tokens": { - "name": "tokens", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "refilled_at": { - "name": "refilled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "day": { - "name": "day", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "day_count": { - "name": "day_count", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.public_license_policy": { - "name": "public_license_policy", - "schema": "conditions", - "columns": { - "license": { - "name": "license", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.smn_cap_decision": { - "name": "smn_cap_decision", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "decision": { - "name": "decision", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.smn_cap_message": { - "name": "smn_cap_message", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "identifier": { - "name": "identifier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "variant": { - "name": "variant", - "type": "text", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "encode(sha256(body), 'hex')", - "type": "stored" - } - }, - "retrieval": { - "name": "retrieval", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{\"legacy\":true}'::jsonb" - }, - "body": { - "name": "body", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "retain_until": { - "name": "retain_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "smn_cap_message_source_id_variant_pk": { - "name": "smn_cap_message_source_id_variant_pk", - "columns": [ - "source_id", - "variant" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_shrink": { - "name": "source_shrink", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "since": { - "name": "since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "polls": { - "name": "polls", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "stated": { - "name": "stated", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "held": { - "name": "held", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "source_shrink_source_id_scope_pk": { - "name": "source_shrink_source_id_scope_pk", - "columns": [ - "source_id", - "scope" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_shrink_scope_enum": { - "name": "source_shrink_scope_enum", - "value": "\"conditions\".\"source_shrink\".\"scope\" IN ('series','records')" - } - }, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "source_published_at": { - "name": "source_published_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.oauth_grant": { - "name": "oauth_grant", - "schema": "conditions", - "columns": { - "grant_key": { - "name": "grant_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_issued_at": { - "name": "refresh_issued_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_expires_at": { - "name": "access_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "rejected_at": { - "name": "rejected_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "product": { - "name": "product", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "credit_name": { - "name": "credit_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_url": { - "name": "credit_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_notice": { - "name": "credit_notice", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "restricted": { - "name": "restricted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restricted_since": { - "name": "restricted_since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fusion_restricted": { - "name": "fusion_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "fusion_tier": { - "name": "fusion_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "fusion_licenses": { - "name": "fusion_licenses", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "federation_restricted": { - "name": "federation_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "federation_pending": { - "name": "federation_pending", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0102_snapshot.json b/packages/core/drizzle/meta/0102_snapshot.json deleted file mode 100644 index 5146c12af..000000000 --- a/packages/core/drizzle/meta/0102_snapshot.json +++ /dev/null @@ -1,6717 +0,0 @@ -{ - "id": "81ab8185-a271-4968-9705-a6b239fc8952", - "prevId": "a8f63ed8-cffc-4ad6-a8b0-3dd7b6e5d672", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.report_refusal": { - "name": "report_refusal", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_report_refusal_actor": { - "name": "idx_report_refusal_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_refusal_occurred": { - "name": "idx_report_refusal_occurred", - "columns": [ - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.jma_budget": { - "name": "jma_budget", - "schema": "conditions", - "columns": { - "egress": { - "name": "egress", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "day": { - "name": "day", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "used": { - "name": "used", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "reserved": { - "name": "reserved", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "jma_budget_egress_day_pk": { - "name": "jma_budget_egress_day_pk", - "columns": [ - "egress", - "day" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "jma_budget_nonnegative": { - "name": "jma_budget_nonnegative", - "value": "\"conditions\".\"jma_budget\".\"used\" >= 0 AND \"conditions\".\"jma_budget\".\"reserved\" >= 0" - } - }, - "isRLSEnabled": false - }, - "conditions.jma_download": { - "name": "jma_download", - "schema": "conditions", - "columns": { - "url": { - "name": "url", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.jma_state": { - "name": "jma_state", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.contributor_receipt": { - "name": "contributor_receipt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "version": { - "name": "version", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "contributors": { - "name": "contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "provenance": { - "name": "provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "reading": { - "name": "reading", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template_hash": { - "name": "template_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_id": { - "name": "contributor_receipt_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "crowd_record_id": { - "name": "crowd_record_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_sources": { - "name": "fused_sources", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_public": { - "name": "fused_public", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_source": { - "name": "idx_observation_latest_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "series_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_effective_brin": { - "name": "idx_observation_latest_effective_brin", - "columns": [ - { - "expression": "effective_from", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "brin", - "with": {} - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "crowd_record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"crowd_record_id\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "nullsNotDistinct": false, - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ] - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - }, - "idx_feature_rights_revoked": { - "name": "idx_feature_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"feature\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\" COLLATE \"C\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_rights_revoked": { - "name": "idx_offer_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"offer\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "tableTo": "offer", - "schemaTo": "conditions", - "columnsFrom": [ - "offer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_rights_revoked": { - "name": "idx_situation_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('none', 'minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_erasure": { - "name": "archive_erasure", - "schema": "conditions", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "applied_at": { - "name": "applied_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_file": { - "name": "archive_file", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "file_name": { - "name": "file_name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sha256": { - "name": "sha256", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "bytes": { - "name": "bytes", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "built_at": { - "name": "built_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "endorsed_by": { - "name": "endorsed_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "endorsement": { - "name": "endorsement", - "type": "bytea", - "primaryKey": false, - "notNull": false - }, - "endorsement_proof": { - "name": "endorsement_proof", - "type": "bytea", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_journal": { - "name": "federation_journal", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "epoch": { - "name": "epoch", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "started_at": { - "name": "started_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_xid": { - "name": "seen_xid", - "type": "xid8", - "primaryKey": false, - "notNull": true - }, - "timeline_id": { - "name": "timeline_id", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_journal_single_row": { - "name": "federation_journal_single_row", - "value": "\"conditions\".\"federation_journal\".\"singleton\"" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_lapsed_copy": { - "name": "federation_lapsed_copy", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "lapsed_at": { - "name": "lapsed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_lapsed_copy_source": { - "name": "idx_federation_lapsed_copy_source", - "columns": [ - { - "expression": "peer_instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_lapsed_copy_record_class_record_id_pk": { - "name": "federation_lapsed_copy_record_class_record_id_pk", - "columns": [ - "record_class", - "record_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete','liveness')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_cursor": { - "name": "federation_peer_cursor", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "archive_built_at": { - "name": "archive_built_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "archive_landed_at": { - "name": "archive_landed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "journal_epoch": { - "name": "journal_epoch", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor_reset_at": { - "name": "cursor_reset_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_key": { - "name": "federation_peer_key", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "anchor": { - "name": "anchor", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "learned_at": { - "name": "learned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_peer_key_peer_instance_id_key_id_pk": { - "name": "federation_peer_key_peer_instance_id_key_id_pk", - "columns": [ - "peer_instance_id", - "key_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_source_receipt": { - "name": "federation_source_receipt", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_received_at": { - "name": "last_received_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "liveness_at": { - "name": "liveness_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_source_receipt_peer_instance_id_source_id_pk": { - "name": "federation_source_receipt_peer_instance_id_source_id_pk", - "columns": [ - "peer_instance_id", - "source_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now() + interval '30 days'" - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "uq_federation_subscription_target": { - "name": "uq_federation_subscription_target", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "delivery_mode", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "coalesce(\"inbox_url\", '')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"conditions\".\"federation_subscription\".\"delivery_mode\" <> 'sse'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.geonet_coverage": { - "name": "geonet_coverage", - "schema": "conditions", - "columns": { - "revisions": { - "name": "revisions", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "covered_from": { - "name": "covered_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "covered_until": { - "name": "covered_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.nsw_rfs_clock": { - "name": "nsw_rfs_clock", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "incident_id": { - "name": "incident_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sent": { - "name": "sent", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expiry": { - "name": "expiry", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "nsw_rfs_clock_source_id_incident_id_pk": { - "name": "nsw_rfs_clock_source_id_incident_id_pk", - "columns": [ - "source_id", - "incident_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_revision": { - "name": "observation_revision", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "measured_at": { - "name": "measured_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "rank": { - "name": "rank", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "suppressed": { - "name": "suppressed", - "type": "boolean", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "observation_revision_source_id_feature_id_property_pk": { - "name": "observation_revision_source_id_feature_id_property_pk", - "columns": [ - "source_id", - "feature_id", - "property" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.on_demand_fetch": { - "name": "on_demand_fetch", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "retry_at": { - "name": "retry_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "claimed_until": { - "name": "claimed_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "on_demand_fetch_source_id_cell_pk": { - "name": "on_demand_fetch_source_id_cell_pk", - "columns": [ - "source_id", - "cell" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "on_demand_fetch_status_enum": { - "name": "on_demand_fetch_status_enum", - "value": "\"conditions\".\"on_demand_fetch\".\"status\" IN ('pending','fresh','failed')" - } - }, - "isRLSEnabled": false - }, - "conditions.on_demand_quota": { - "name": "on_demand_quota", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "tokens": { - "name": "tokens", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "refilled_at": { - "name": "refilled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "day": { - "name": "day", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "day_count": { - "name": "day_count", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.public_license_policy": { - "name": "public_license_policy", - "schema": "conditions", - "columns": { - "license": { - "name": "license", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.smn_cap_decision": { - "name": "smn_cap_decision", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "decision": { - "name": "decision", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.smn_cap_message": { - "name": "smn_cap_message", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "identifier": { - "name": "identifier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "variant": { - "name": "variant", - "type": "text", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "encode(sha256(body), 'hex')", - "type": "stored" - } - }, - "retrieval": { - "name": "retrieval", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{\"legacy\":true}'::jsonb" - }, - "body": { - "name": "body", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "retain_until": { - "name": "retain_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "smn_cap_message_source_id_variant_pk": { - "name": "smn_cap_message_source_id_variant_pk", - "columns": [ - "source_id", - "variant" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_shrink": { - "name": "source_shrink", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "since": { - "name": "since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "polls": { - "name": "polls", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "stated": { - "name": "stated", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "held": { - "name": "held", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "source_shrink_source_id_scope_pk": { - "name": "source_shrink_source_id_scope_pk", - "columns": [ - "source_id", - "scope" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_shrink_scope_enum": { - "name": "source_shrink_scope_enum", - "value": "\"conditions\".\"source_shrink\".\"scope\" IN ('series','records')" - } - }, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "source_published_at": { - "name": "source_published_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.oauth_grant": { - "name": "oauth_grant", - "schema": "conditions", - "columns": { - "grant_key": { - "name": "grant_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_issued_at": { - "name": "refresh_issued_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_expires_at": { - "name": "access_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "rejected_at": { - "name": "rejected_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "product": { - "name": "product", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "credit_name": { - "name": "credit_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_url": { - "name": "credit_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_notice": { - "name": "credit_notice", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "restricted": { - "name": "restricted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restricted_since": { - "name": "restricted_since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fusion_restricted": { - "name": "fusion_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "fusion_tier": { - "name": "fusion_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "fusion_licenses": { - "name": "fusion_licenses", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "federation_restricted": { - "name": "federation_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "federation_pending": { - "name": "federation_pending", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0103_snapshot.json b/packages/core/drizzle/meta/0103_snapshot.json deleted file mode 100644 index e7493fc06..000000000 --- a/packages/core/drizzle/meta/0103_snapshot.json +++ /dev/null @@ -1,6792 +0,0 @@ -{ - "id": "72f475b8-28b1-4c11-bf37-7d1aee106e86", - "prevId": "81ab8185-a271-4968-9705-a6b239fc8952", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.report_refusal": { - "name": "report_refusal", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_report_refusal_actor": { - "name": "idx_report_refusal_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_refusal_occurred": { - "name": "idx_report_refusal_occurred", - "columns": [ - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.jma_budget": { - "name": "jma_budget", - "schema": "conditions", - "columns": { - "egress": { - "name": "egress", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "day": { - "name": "day", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "used": { - "name": "used", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "reserved": { - "name": "reserved", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "jma_budget_egress_day_pk": { - "name": "jma_budget_egress_day_pk", - "columns": [ - "egress", - "day" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "jma_budget_nonnegative": { - "name": "jma_budget_nonnegative", - "value": "\"conditions\".\"jma_budget\".\"used\" >= 0 AND \"conditions\".\"jma_budget\".\"reserved\" >= 0" - } - }, - "isRLSEnabled": false - }, - "conditions.jma_download": { - "name": "jma_download", - "schema": "conditions", - "columns": { - "url": { - "name": "url", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.jma_state": { - "name": "jma_state", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.contributor_receipt": { - "name": "contributor_receipt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "version": { - "name": "version", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "contributors": { - "name": "contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "provenance": { - "name": "provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "reading": { - "name": "reading", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template_hash": { - "name": "template_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_id": { - "name": "contributor_receipt_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "crowd_record_id": { - "name": "crowd_record_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_sources": { - "name": "fused_sources", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_public": { - "name": "fused_public", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_source": { - "name": "idx_observation_latest_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "series_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_effective_brin": { - "name": "idx_observation_latest_effective_brin", - "columns": [ - { - "expression": "effective_from", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "brin", - "with": {} - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "crowd_record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"crowd_record_id\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "nullsNotDistinct": false, - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ] - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - }, - "idx_feature_rights_revoked": { - "name": "idx_feature_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"feature\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_id_bytes": { - "name": "idx_feature_id_bytes", - "columns": [ - { - "expression": "\"id\" COLLATE \"C\"", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\" COLLATE \"C\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_rights_revoked": { - "name": "idx_offer_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"offer\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_id_bytes": { - "name": "idx_offer_id_bytes", - "columns": [ - { - "expression": "\"id\" COLLATE \"C\"", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "tableTo": "offer", - "schemaTo": "conditions", - "columnsFrom": [ - "offer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_rights_revoked": { - "name": "idx_situation_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_id_bytes": { - "name": "idx_situation_id_bytes", - "columns": [ - { - "expression": "\"id\" COLLATE \"C\"", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('none', 'minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_erasure": { - "name": "archive_erasure", - "schema": "conditions", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "applied_at": { - "name": "applied_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_file": { - "name": "archive_file", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "file_name": { - "name": "file_name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sha256": { - "name": "sha256", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "bytes": { - "name": "bytes", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "built_at": { - "name": "built_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "endorsed_by": { - "name": "endorsed_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "endorsement": { - "name": "endorsement", - "type": "bytea", - "primaryKey": false, - "notNull": false - }, - "endorsement_proof": { - "name": "endorsement_proof", - "type": "bytea", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_journal": { - "name": "federation_journal", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "epoch": { - "name": "epoch", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "started_at": { - "name": "started_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_xid": { - "name": "seen_xid", - "type": "xid8", - "primaryKey": false, - "notNull": true - }, - "timeline_id": { - "name": "timeline_id", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_journal_single_row": { - "name": "federation_journal_single_row", - "value": "\"conditions\".\"federation_journal\".\"singleton\"" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_lapsed_copy": { - "name": "federation_lapsed_copy", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "lapsed_at": { - "name": "lapsed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_lapsed_copy_source": { - "name": "idx_federation_lapsed_copy_source", - "columns": [ - { - "expression": "peer_instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_lapsed_copy_record_class_record_id_pk": { - "name": "federation_lapsed_copy_record_class_record_id_pk", - "columns": [ - "record_class", - "record_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete','liveness')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "protocol_version": { - "name": "protocol_version", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_cursor": { - "name": "federation_peer_cursor", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "archive_built_at": { - "name": "archive_built_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "archive_landed_at": { - "name": "archive_landed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "journal_epoch": { - "name": "journal_epoch", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor_reset_at": { - "name": "cursor_reset_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "reconcile_due_since": { - "name": "reconcile_due_since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "reconcile_class": { - "name": "reconcile_class", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reconcile_after": { - "name": "reconcile_after", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reconciled_at": { - "name": "reconciled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_key": { - "name": "federation_peer_key", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "anchor": { - "name": "anchor", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "learned_at": { - "name": "learned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_peer_key_peer_instance_id_key_id_pk": { - "name": "federation_peer_key_peer_instance_id_key_id_pk", - "columns": [ - "peer_instance_id", - "key_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_source_receipt": { - "name": "federation_source_receipt", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_received_at": { - "name": "last_received_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "liveness_at": { - "name": "liveness_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_source_receipt_peer_instance_id_source_id_pk": { - "name": "federation_source_receipt_peer_instance_id_source_id_pk", - "columns": [ - "peer_instance_id", - "source_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now() + interval '30 days'" - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "uq_federation_subscription_target": { - "name": "uq_federation_subscription_target", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "delivery_mode", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "coalesce(\"inbox_url\", '')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"conditions\".\"federation_subscription\".\"delivery_mode\" <> 'sse'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.geonet_coverage": { - "name": "geonet_coverage", - "schema": "conditions", - "columns": { - "revisions": { - "name": "revisions", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "covered_from": { - "name": "covered_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "covered_until": { - "name": "covered_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.nsw_rfs_clock": { - "name": "nsw_rfs_clock", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "incident_id": { - "name": "incident_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sent": { - "name": "sent", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expiry": { - "name": "expiry", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "nsw_rfs_clock_source_id_incident_id_pk": { - "name": "nsw_rfs_clock_source_id_incident_id_pk", - "columns": [ - "source_id", - "incident_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_revision": { - "name": "observation_revision", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "measured_at": { - "name": "measured_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "rank": { - "name": "rank", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "suppressed": { - "name": "suppressed", - "type": "boolean", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "observation_revision_source_id_feature_id_property_pk": { - "name": "observation_revision_source_id_feature_id_property_pk", - "columns": [ - "source_id", - "feature_id", - "property" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.on_demand_fetch": { - "name": "on_demand_fetch", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "retry_at": { - "name": "retry_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "claimed_until": { - "name": "claimed_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "on_demand_fetch_source_id_cell_pk": { - "name": "on_demand_fetch_source_id_cell_pk", - "columns": [ - "source_id", - "cell" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "on_demand_fetch_status_enum": { - "name": "on_demand_fetch_status_enum", - "value": "\"conditions\".\"on_demand_fetch\".\"status\" IN ('pending','fresh','failed')" - } - }, - "isRLSEnabled": false - }, - "conditions.on_demand_quota": { - "name": "on_demand_quota", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "tokens": { - "name": "tokens", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "refilled_at": { - "name": "refilled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "day": { - "name": "day", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "day_count": { - "name": "day_count", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.public_license_policy": { - "name": "public_license_policy", - "schema": "conditions", - "columns": { - "license": { - "name": "license", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.smn_cap_decision": { - "name": "smn_cap_decision", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "decision": { - "name": "decision", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.smn_cap_message": { - "name": "smn_cap_message", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "identifier": { - "name": "identifier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "variant": { - "name": "variant", - "type": "text", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "encode(sha256(body), 'hex')", - "type": "stored" - } - }, - "retrieval": { - "name": "retrieval", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{\"legacy\":true}'::jsonb" - }, - "body": { - "name": "body", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "retain_until": { - "name": "retain_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "smn_cap_message_source_id_variant_pk": { - "name": "smn_cap_message_source_id_variant_pk", - "columns": [ - "source_id", - "variant" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_shrink": { - "name": "source_shrink", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "since": { - "name": "since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "polls": { - "name": "polls", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "stated": { - "name": "stated", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "held": { - "name": "held", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "source_shrink_source_id_scope_pk": { - "name": "source_shrink_source_id_scope_pk", - "columns": [ - "source_id", - "scope" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_shrink_scope_enum": { - "name": "source_shrink_scope_enum", - "value": "\"conditions\".\"source_shrink\".\"scope\" IN ('series','records')" - } - }, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "source_published_at": { - "name": "source_published_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.oauth_grant": { - "name": "oauth_grant", - "schema": "conditions", - "columns": { - "grant_key": { - "name": "grant_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_issued_at": { - "name": "refresh_issued_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_expires_at": { - "name": "access_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "rejected_at": { - "name": "rejected_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "product": { - "name": "product", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "credit_name": { - "name": "credit_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_url": { - "name": "credit_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_notice": { - "name": "credit_notice", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "restricted": { - "name": "restricted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restricted_since": { - "name": "restricted_since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fusion_restricted": { - "name": "fusion_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "fusion_tier": { - "name": "fusion_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "fusion_licenses": { - "name": "fusion_licenses", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "federation_restricted": { - "name": "federation_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "federation_pending": { - "name": "federation_pending", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0104_snapshot.json b/packages/core/drizzle/meta/0104_snapshot.json deleted file mode 100644 index 2784da796..000000000 --- a/packages/core/drizzle/meta/0104_snapshot.json +++ /dev/null @@ -1,6804 +0,0 @@ -{ - "id": "b30c53e5-5351-45ba-b954-3575aa34f9e0", - "prevId": "72f475b8-28b1-4c11-bf37-7d1aee106e86", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.report_refusal": { - "name": "report_refusal", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_report_refusal_actor": { - "name": "idx_report_refusal_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_refusal_occurred": { - "name": "idx_report_refusal_occurred", - "columns": [ - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.jma_budget": { - "name": "jma_budget", - "schema": "conditions", - "columns": { - "egress": { - "name": "egress", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "day": { - "name": "day", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "used": { - "name": "used", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "reserved": { - "name": "reserved", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "jma_budget_egress_day_pk": { - "name": "jma_budget_egress_day_pk", - "columns": [ - "egress", - "day" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "jma_budget_nonnegative": { - "name": "jma_budget_nonnegative", - "value": "\"conditions\".\"jma_budget\".\"used\" >= 0 AND \"conditions\".\"jma_budget\".\"reserved\" >= 0" - } - }, - "isRLSEnabled": false - }, - "conditions.jma_download": { - "name": "jma_download", - "schema": "conditions", - "columns": { - "url": { - "name": "url", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.jma_state": { - "name": "jma_state", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.contributor_receipt": { - "name": "contributor_receipt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "version": { - "name": "version", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "contributors": { - "name": "contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "provenance": { - "name": "provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "reading": { - "name": "reading", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template_hash": { - "name": "template_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_id": { - "name": "contributor_receipt_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "crowd_record_id": { - "name": "crowd_record_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_sources": { - "name": "fused_sources", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_public": { - "name": "fused_public", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_source": { - "name": "idx_observation_latest_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "series_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_effective_brin": { - "name": "idx_observation_latest_effective_brin", - "columns": [ - { - "expression": "effective_from", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "brin", - "with": {} - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "crowd_record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"crowd_record_id\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "nullsNotDistinct": false, - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ] - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - }, - "idx_feature_rights_revoked": { - "name": "idx_feature_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"feature\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_id_bytes": { - "name": "idx_feature_id_bytes", - "columns": [ - { - "expression": "\"id\" COLLATE \"C\"", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\" COLLATE \"C\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_rights_revoked": { - "name": "idx_offer_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"offer\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_id_bytes": { - "name": "idx_offer_id_bytes", - "columns": [ - { - "expression": "\"id\" COLLATE \"C\"", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "tableTo": "offer", - "schemaTo": "conditions", - "columnsFrom": [ - "offer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_rights_revoked": { - "name": "idx_situation_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_id_bytes": { - "name": "idx_situation_id_bytes", - "columns": [ - { - "expression": "\"id\" COLLATE \"C\"", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('none', 'minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_erasure": { - "name": "archive_erasure", - "schema": "conditions", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "applied_at": { - "name": "applied_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_file": { - "name": "archive_file", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "file_name": { - "name": "file_name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sha256": { - "name": "sha256", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "bytes": { - "name": "bytes", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "built_at": { - "name": "built_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "endorsed_by": { - "name": "endorsed_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "endorsement": { - "name": "endorsement", - "type": "bytea", - "primaryKey": false, - "notNull": false - }, - "endorsement_proof": { - "name": "endorsement_proof", - "type": "bytea", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_journal": { - "name": "federation_journal", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "epoch": { - "name": "epoch", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "started_at": { - "name": "started_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_xid": { - "name": "seen_xid", - "type": "xid8", - "primaryKey": false, - "notNull": true - }, - "timeline_id": { - "name": "timeline_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "database_oid": { - "name": "database_oid", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "system_identifier": { - "name": "system_identifier", - "type": "bigint", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_journal_single_row": { - "name": "federation_journal_single_row", - "value": "\"conditions\".\"federation_journal\".\"singleton\"" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_lapsed_copy": { - "name": "federation_lapsed_copy", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "lapsed_at": { - "name": "lapsed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_lapsed_copy_source": { - "name": "idx_federation_lapsed_copy_source", - "columns": [ - { - "expression": "peer_instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_lapsed_copy_record_class_record_id_pk": { - "name": "federation_lapsed_copy_record_class_record_id_pk", - "columns": [ - "record_class", - "record_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete','liveness')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "protocol_version": { - "name": "protocol_version", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_cursor": { - "name": "federation_peer_cursor", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "archive_built_at": { - "name": "archive_built_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "archive_landed_at": { - "name": "archive_landed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "journal_epoch": { - "name": "journal_epoch", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor_reset_at": { - "name": "cursor_reset_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "reconcile_due_since": { - "name": "reconcile_due_since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "reconcile_class": { - "name": "reconcile_class", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reconcile_after": { - "name": "reconcile_after", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reconciled_at": { - "name": "reconciled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_key": { - "name": "federation_peer_key", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "anchor": { - "name": "anchor", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "learned_at": { - "name": "learned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_peer_key_peer_instance_id_key_id_pk": { - "name": "federation_peer_key_peer_instance_id_key_id_pk", - "columns": [ - "peer_instance_id", - "key_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_source_receipt": { - "name": "federation_source_receipt", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_received_at": { - "name": "last_received_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "liveness_at": { - "name": "liveness_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_source_receipt_peer_instance_id_source_id_pk": { - "name": "federation_source_receipt_peer_instance_id_source_id_pk", - "columns": [ - "peer_instance_id", - "source_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now() + interval '30 days'" - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "uq_federation_subscription_target": { - "name": "uq_federation_subscription_target", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "delivery_mode", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "coalesce(\"inbox_url\", '')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"conditions\".\"federation_subscription\".\"delivery_mode\" <> 'sse'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.geonet_coverage": { - "name": "geonet_coverage", - "schema": "conditions", - "columns": { - "revisions": { - "name": "revisions", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "covered_from": { - "name": "covered_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "covered_until": { - "name": "covered_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.nsw_rfs_clock": { - "name": "nsw_rfs_clock", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "incident_id": { - "name": "incident_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sent": { - "name": "sent", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expiry": { - "name": "expiry", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "nsw_rfs_clock_source_id_incident_id_pk": { - "name": "nsw_rfs_clock_source_id_incident_id_pk", - "columns": [ - "source_id", - "incident_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_revision": { - "name": "observation_revision", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "measured_at": { - "name": "measured_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "rank": { - "name": "rank", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "suppressed": { - "name": "suppressed", - "type": "boolean", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "observation_revision_source_id_feature_id_property_pk": { - "name": "observation_revision_source_id_feature_id_property_pk", - "columns": [ - "source_id", - "feature_id", - "property" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.on_demand_fetch": { - "name": "on_demand_fetch", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "retry_at": { - "name": "retry_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "claimed_until": { - "name": "claimed_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "on_demand_fetch_source_id_cell_pk": { - "name": "on_demand_fetch_source_id_cell_pk", - "columns": [ - "source_id", - "cell" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "on_demand_fetch_status_enum": { - "name": "on_demand_fetch_status_enum", - "value": "\"conditions\".\"on_demand_fetch\".\"status\" IN ('pending','fresh','failed')" - } - }, - "isRLSEnabled": false - }, - "conditions.on_demand_quota": { - "name": "on_demand_quota", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "tokens": { - "name": "tokens", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "refilled_at": { - "name": "refilled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "day": { - "name": "day", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "day_count": { - "name": "day_count", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.public_license_policy": { - "name": "public_license_policy", - "schema": "conditions", - "columns": { - "license": { - "name": "license", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.smn_cap_decision": { - "name": "smn_cap_decision", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "decision": { - "name": "decision", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.smn_cap_message": { - "name": "smn_cap_message", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "identifier": { - "name": "identifier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "variant": { - "name": "variant", - "type": "text", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "encode(sha256(body), 'hex')", - "type": "stored" - } - }, - "retrieval": { - "name": "retrieval", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{\"legacy\":true}'::jsonb" - }, - "body": { - "name": "body", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "retain_until": { - "name": "retain_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "smn_cap_message_source_id_variant_pk": { - "name": "smn_cap_message_source_id_variant_pk", - "columns": [ - "source_id", - "variant" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_shrink": { - "name": "source_shrink", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "since": { - "name": "since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "polls": { - "name": "polls", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "stated": { - "name": "stated", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "held": { - "name": "held", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "source_shrink_source_id_scope_pk": { - "name": "source_shrink_source_id_scope_pk", - "columns": [ - "source_id", - "scope" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_shrink_scope_enum": { - "name": "source_shrink_scope_enum", - "value": "\"conditions\".\"source_shrink\".\"scope\" IN ('series','records')" - } - }, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "source_published_at": { - "name": "source_published_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.oauth_grant": { - "name": "oauth_grant", - "schema": "conditions", - "columns": { - "grant_key": { - "name": "grant_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_issued_at": { - "name": "refresh_issued_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_expires_at": { - "name": "access_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "rejected_at": { - "name": "rejected_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "product": { - "name": "product", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "credit_name": { - "name": "credit_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_url": { - "name": "credit_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_notice": { - "name": "credit_notice", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "restricted": { - "name": "restricted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restricted_since": { - "name": "restricted_since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fusion_restricted": { - "name": "fusion_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "fusion_tier": { - "name": "fusion_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "fusion_licenses": { - "name": "fusion_licenses", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "federation_restricted": { - "name": "federation_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "federation_pending": { - "name": "federation_pending", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0105_snapshot.json b/packages/core/drizzle/meta/0105_snapshot.json deleted file mode 100644 index 3091a4dc4..000000000 --- a/packages/core/drizzle/meta/0105_snapshot.json +++ /dev/null @@ -1,6811 +0,0 @@ -{ - "id": "123c51a8-f3de-4b3e-896d-46094418de0b", - "prevId": "b30c53e5-5351-45ba-b954-3575aa34f9e0", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.report_refusal": { - "name": "report_refusal", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_report_refusal_actor": { - "name": "idx_report_refusal_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_report_refusal_occurred": { - "name": "idx_report_refusal_occurred", - "columns": [ - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.jma_budget": { - "name": "jma_budget", - "schema": "conditions", - "columns": { - "egress": { - "name": "egress", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "day": { - "name": "day", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "used": { - "name": "used", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "reserved": { - "name": "reserved", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "jma_budget_egress_day_pk": { - "name": "jma_budget_egress_day_pk", - "columns": [ - "egress", - "day" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "jma_budget_nonnegative": { - "name": "jma_budget_nonnegative", - "value": "\"conditions\".\"jma_budget\".\"used\" >= 0 AND \"conditions\".\"jma_budget\".\"reserved\" >= 0" - } - }, - "isRLSEnabled": false - }, - "conditions.jma_download": { - "name": "jma_download", - "schema": "conditions", - "columns": { - "url": { - "name": "url", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.jma_state": { - "name": "jma_state", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.contributor_receipt": { - "name": "contributor_receipt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "version": { - "name": "version", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "contributors": { - "name": "contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "provenance": { - "name": "provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "reading": { - "name": "reading", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template_hash": { - "name": "template_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_id": { - "name": "contributor_receipt_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "crowd_record_id": { - "name": "crowd_record_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_sources": { - "name": "fused_sources", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_public": { - "name": "fused_public", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_source": { - "name": "idx_observation_latest_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "series_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_observation_latest_effective_brin": { - "name": "idx_observation_latest_effective_brin", - "columns": [ - { - "expression": "effective_from", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "brin", - "with": {} - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "crowd_record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"observation_latest\".\"crowd_record_id\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "nullsNotDistinct": false, - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ] - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsFrom": [ - "series_id" - ], - "columnsTo": [ - "series_id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - }, - "idx_feature_rights_revoked": { - "name": "idx_feature_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"feature\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_id_bytes": { - "name": "idx_feature_id_bytes", - "columns": [ - { - "expression": "\"id\" COLLATE \"C\"", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": { - "fastupdate": "off" - } - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\" COLLATE \"C\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "tableTo": "feature", - "schemaTo": "conditions", - "columnsFrom": [ - "feature_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_rights_revoked": { - "name": "idx_offer_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"offer\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_offer_id_bytes": { - "name": "idx_offer_id_bytes", - "columns": [ - { - "expression": "\"id\" COLLATE \"C\"", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "tableTo": "offer", - "schemaTo": "conditions", - "columnsFrom": [ - "offer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_rights_revoked": { - "name": "idx_situation_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"conditions\".\"situation\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_id_bytes": { - "name": "idx_situation_id_bytes", - "columns": [ - { - "expression": "\"id\" COLLATE \"C\"", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('none', 'minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "tableTo": "situation", - "schemaTo": "conditions", - "columnsFrom": [ - "situation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_erasure": { - "name": "archive_erasure", - "schema": "conditions", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "applied_at": { - "name": "applied_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_file": { - "name": "archive_file", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "file_name": { - "name": "file_name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sha256": { - "name": "sha256", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "bytes": { - "name": "bytes", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "built_at": { - "name": "built_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "endorsed_by": { - "name": "endorsed_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "endorsement": { - "name": "endorsement", - "type": "bytea", - "primaryKey": false, - "notNull": false - }, - "endorsement_proof": { - "name": "endorsement_proof", - "type": "bytea", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_journal": { - "name": "federation_journal", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "epoch": { - "name": "epoch", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "started_at": { - "name": "started_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_xid": { - "name": "seen_xid", - "type": "xid8", - "primaryKey": false, - "notNull": true - }, - "timeline_id": { - "name": "timeline_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "database_oid": { - "name": "database_oid", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "system_identifier": { - "name": "system_identifier", - "type": "bigint", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_journal_single_row": { - "name": "federation_journal_single_row", - "value": "\"conditions\".\"federation_journal\".\"singleton\"" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_lapsed_copy": { - "name": "federation_lapsed_copy", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "lapsed_at": { - "name": "lapsed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_lapsed_copy_source": { - "name": "idx_federation_lapsed_copy_source", - "columns": [ - { - "expression": "peer_instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_lapsed_copy_record_class_record_id_pk": { - "name": "federation_lapsed_copy_record_class_record_id_pk", - "columns": [ - "record_class", - "record_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete','liveness')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "protocol_version": { - "name": "protocol_version", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_cursor": { - "name": "federation_peer_cursor", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "archive_built_at": { - "name": "archive_built_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "archive_landed_at": { - "name": "archive_landed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "journal_epoch": { - "name": "journal_epoch", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor_reset_at": { - "name": "cursor_reset_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "reconcile_due_since": { - "name": "reconcile_due_since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "reconcile_class": { - "name": "reconcile_class", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reconcile_after": { - "name": "reconcile_after", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reconciled_at": { - "name": "reconciled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_key": { - "name": "federation_peer_key", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "anchor": { - "name": "anchor", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "learned_at": { - "name": "learned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_peer_key_peer_instance_id_key_id_pk": { - "name": "federation_peer_key_peer_instance_id_key_id_pk", - "columns": [ - "peer_instance_id", - "key_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_source_receipt": { - "name": "federation_source_receipt", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_received_at": { - "name": "last_received_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "liveness_at": { - "name": "liveness_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_source_receipt_peer_instance_id_source_id_pk": { - "name": "federation_source_receipt_peer_instance_id_source_id_pk", - "columns": [ - "peer_instance_id", - "source_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now() + interval '30 days'" - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "uq_federation_subscription_target": { - "name": "uq_federation_subscription_target", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "delivery_mode", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "coalesce(\"inbox_url\", '')", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"conditions\".\"federation_subscription\".\"delivery_mode\" <> 'sse'", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.geonet_coverage": { - "name": "geonet_coverage", - "schema": "conditions", - "columns": { - "revisions": { - "name": "revisions", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "covered_from": { - "name": "covered_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "covered_until": { - "name": "covered_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.nsw_rfs_clock": { - "name": "nsw_rfs_clock", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "incident_id": { - "name": "incident_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sent": { - "name": "sent", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expiry": { - "name": "expiry", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "nsw_rfs_clock_source_id_incident_id_pk": { - "name": "nsw_rfs_clock_source_id_incident_id_pk", - "columns": [ - "source_id", - "incident_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_revision": { - "name": "observation_revision", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "measured_at": { - "name": "measured_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "rank": { - "name": "rank", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "suppressed": { - "name": "suppressed", - "type": "boolean", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "observation_revision_source_id_feature_id_property_pk": { - "name": "observation_revision_source_id_feature_id_property_pk", - "columns": [ - "source_id", - "feature_id", - "property" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.on_demand_fetch": { - "name": "on_demand_fetch", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "retry_at": { - "name": "retry_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "claimed_until": { - "name": "claimed_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "on_demand_fetch_source_id_cell_pk": { - "name": "on_demand_fetch_source_id_cell_pk", - "columns": [ - "source_id", - "cell" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "on_demand_fetch_status_enum": { - "name": "on_demand_fetch_status_enum", - "value": "\"conditions\".\"on_demand_fetch\".\"status\" IN ('pending','fresh','failed')" - } - }, - "isRLSEnabled": false - }, - "conditions.on_demand_quota": { - "name": "on_demand_quota", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "tokens": { - "name": "tokens", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "refilled_at": { - "name": "refilled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "day": { - "name": "day", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "day_count": { - "name": "day_count", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "oneway_reversed": { - "name": "oneway_reversed", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.public_license_policy": { - "name": "public_license_policy", - "schema": "conditions", - "columns": { - "license": { - "name": "license", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.smn_cap_decision": { - "name": "smn_cap_decision", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "decision": { - "name": "decision", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.smn_cap_message": { - "name": "smn_cap_message", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "identifier": { - "name": "identifier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "variant": { - "name": "variant", - "type": "text", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "encode(sha256(body), 'hex')", - "type": "stored" - } - }, - "retrieval": { - "name": "retrieval", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{\"legacy\":true}'::jsonb" - }, - "body": { - "name": "body", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "retain_until": { - "name": "retain_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "smn_cap_message_source_id_variant_pk": { - "name": "smn_cap_message_source_id_variant_pk", - "columns": [ - "source_id", - "variant" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_shrink": { - "name": "source_shrink", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "since": { - "name": "since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "polls": { - "name": "polls", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "stated": { - "name": "stated", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "held": { - "name": "held", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "source_shrink_source_id_scope_pk": { - "name": "source_shrink_source_id_scope_pk", - "columns": [ - "source_id", - "scope" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_shrink_scope_enum": { - "name": "source_shrink_scope_enum", - "value": "\"conditions\".\"source_shrink\".\"scope\" IN ('series','records')" - } - }, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "source_published_at": { - "name": "source_published_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.oauth_grant": { - "name": "oauth_grant", - "schema": "conditions", - "columns": { - "grant_key": { - "name": "grant_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_issued_at": { - "name": "refresh_issued_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_expires_at": { - "name": "access_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "rejected_at": { - "name": "rejected_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "product": { - "name": "product", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "credit_name": { - "name": "credit_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_url": { - "name": "credit_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_notice": { - "name": "credit_notice", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "restricted": { - "name": "restricted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restricted_since": { - "name": "restricted_since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fusion_restricted": { - "name": "fusion_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "fusion_tier": { - "name": "fusion_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "fusion_licenses": { - "name": "fusion_licenses", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "federation_restricted": { - "name": "federation_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "federation_pending": { - "name": "federation_pending", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/0106_snapshot.json b/packages/core/drizzle/meta/0106_snapshot.json deleted file mode 100644 index 58e4c3259..000000000 --- a/packages/core/drizzle/meta/0106_snapshot.json +++ /dev/null @@ -1,6811 +0,0 @@ -{ - "id": "1284656d-5254-4898-8e1e-44018dee46dd", - "prevId": "123c51a8-f3de-4b3e-896d-46094418de0b", - "version": "7", - "dialect": "postgresql", - "tables": { - "conditions.binding_queue": { - "name": "binding_queue", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "next_attempt_at": { - "name": "next_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_binding_queue_due": { - "name": "idx_binding_queue_due", - "columns": [ - { - "expression": "next_attempt_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "binding_queue_record_class_record_id_effect_id_pk": { - "name": "binding_queue_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_binding": { - "name": "record_binding", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "direction_mode": { - "name": "direction_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "candidate_count": { - "name": "candidate_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "alternative_confidence": { - "name": "alternative_confidence", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "resolver_version": { - "name": "resolver_version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom_hash": { - "name": "geom_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_revision": { - "name": "record_revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "graph_generation": { - "name": "graph_generation", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bound_at": { - "name": "bound_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_binding_status": { - "name": "idx_record_binding_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_binding_record_class_record_id_effect_id_pk": { - "name": "record_binding_record_class_record_id_effect_id_pk", - "columns": [ - "record_class", - "record_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_binding_record_class_enum": { - "name": "record_binding_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.record_segment": { - "name": "record_segment", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "seq": { - "name": "seq", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_fraction": { - "name": "start_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "end_fraction": { - "name": "end_fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_record_segment_segment": { - "name": "idx_record_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_segment_record_class_record_id_effect_id_seq_pk": { - "name": "record_segment_record_class_record_id_effect_id_seq_pk", - "columns": [ - "record_class", - "record_id", - "effect_id", - "seq" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.report_evidence": { - "name": "report_evidence", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "evidence_kind": { - "name": "evidence_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "idx_report_evidence_record": { - "name": "idx_report_evidence_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_report_evidence_actor": { - "name": "idx_report_evidence_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_report_evidence_merged": { - "name": "idx_report_evidence_merged", - "columns": [ - { - "expression": "(\"details\" ->> 'merged')", - "isExpression": true, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"report_evidence\".\"details\" ? 'merged'", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "report_evidence_kind_enum": { - "name": "report_evidence_kind_enum", - "value": "\"evidence_kind\" IN ('report', 'confirm', 'negate', 'official_match', 'reviewer_accept', 'reviewer_reject')" - }, - "report_evidence_record_class_enum": { - "name": "report_evidence_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.report_refusal": { - "name": "report_refusal", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "actor_key_id": { - "name": "actor_key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "occurred_at": { - "name": "occurred_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_report_refusal_actor": { - "name": "idx_report_refusal_actor", - "columns": [ - { - "expression": "actor_key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_report_refusal_occurred": { - "name": "idx_report_refusal_occurred", - "columns": [ - { - "expression": "occurred_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sub_claim": { - "name": "sub_claim", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_component_key": { - "name": "subject_component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "claim_type": { - "name": "claim_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "uq_sub_claim_subject_key_type": { - "name": "uq_sub_claim_subject_key_type", - "columns": [ - { - "expression": "subject_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "subject_component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "claim_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_sub_claim_key": { - "name": "idx_sub_claim_key", - "columns": [ - { - "expression": "key_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "sub_claim_claim_type_enum": { - "name": "sub_claim_claim_type_enum", - "value": "\"claim_type\" IN ('confirm', 'negate', 'flag')" - }, - "sub_claim_subject_class_enum": { - "name": "sub_claim_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.jma_budget": { - "name": "jma_budget", - "schema": "conditions", - "columns": { - "egress": { - "name": "egress", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "day": { - "name": "day", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "used": { - "name": "used", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "reserved": { - "name": "reserved", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "jma_budget_egress_day_pk": { - "name": "jma_budget_egress_day_pk", - "columns": [ - "egress", - "day" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "jma_budget_nonnegative": { - "name": "jma_budget_nonnegative", - "value": "\"conditions\".\"jma_budget\".\"used\" >= 0 AND \"conditions\".\"jma_budget\".\"reserved\" >= 0" - } - }, - "isRLSEnabled": false - }, - "conditions.jma_download": { - "name": "jma_download", - "schema": "conditions", - "columns": { - "url": { - "name": "url", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.jma_state": { - "name": "jma_state", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.contributor_receipt": { - "name": "contributor_receipt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "version": { - "name": "version", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "contributors": { - "name": "contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "provenance": { - "name": "provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_latest": { - "name": "observation_latest", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "qualifier_key": { - "name": "qualifier_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_kind": { - "name": "subject_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "reading": { - "name": "reading", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "template_hash": { - "name": "template_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_id": { - "name": "contributor_receipt_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "crowd_record_id": { - "name": "crowd_record_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "result_type": { - "name": "result_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "value_num": { - "name": "value_num", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "value_money": { - "name": "value_money", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "effective_until": { - "name": "effective_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "since_at": { - "name": "since_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "fused_from": { - "name": "fused_from", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_sources": { - "name": "fused_sources", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "fused_public": { - "name": "fused_public", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_observation_latest_geom": { - "name": "idx_observation_latest_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_observation_latest_property_text": { - "name": "idx_observation_latest_property_text", - "columns": [ - { - "expression": "property", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "value_text", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_observation_latest_source": { - "name": "idx_observation_latest_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "series_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_observation_latest_component": { - "name": "idx_observation_latest_component", - "columns": [ - { - "expression": "feature_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_observation_latest_fuel_price": { - "name": "idx_observation_latest_fuel_price", - "columns": [ - { - "expression": "value_money", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"observation_latest\".\"property\" = 'fuel.price'", - "concurrently": false - }, - "idx_observation_latest_expires": { - "name": "idx_observation_latest_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"observation_latest\".\"expires_at\" IS NOT NULL", - "concurrently": false - }, - "idx_observation_latest_effective_brin": { - "name": "idx_observation_latest_effective_brin", - "columns": [ - { - "expression": "effective_from", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "brin", - "concurrently": false - }, - "idx_observation_latest_crowd_record": { - "name": "idx_observation_latest_crowd_record", - "columns": [ - { - "expression": "crowd_record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"observation_latest\".\"crowd_record_id\" IS NOT NULL", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "observation_latest_series": { - "name": "observation_latest_series", - "columns": [ - "subject_key", - "property", - "qualifier_key", - "source_id" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": { - "observation_latest_access_mode_enum": { - "name": "observation_latest_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "observation_latest_evidence_state_enum": { - "name": "observation_latest_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.observation_rollup_daily": { - "name": "observation_rollup_daily", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "day_utc": { - "name": "day_utc", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_daily_day": { - "name": "idx_observation_rollup_daily_day", - "columns": [ - { - "expression": "day_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "observation_rollup_daily_series_fk": { - "name": "observation_rollup_daily_series_fk", - "tableFrom": "observation_rollup_daily", - "columnsFrom": [ - "series_id" - ], - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsTo": [ - "series_id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "observation_rollup_daily_series_id_day_utc_pk": { - "name": "observation_rollup_daily_series_id_day_utc_pk", - "columns": [ - "series_id", - "day_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_hourly": { - "name": "observation_rollup_hourly", - "schema": "conditions", - "columns": { - "series_id": { - "name": "series_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hour_utc": { - "name": "hour_utc", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "bins": { - "name": "bins", - "type": "smallint[]", - "primaryKey": false, - "notNull": false - }, - "counts": { - "name": "counts", - "type": "integer[]", - "primaryKey": false, - "notNull": false - }, - "min": { - "name": "min", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "max": { - "name": "max", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "mean": { - "name": "mean", - "type": "double precision", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_observation_rollup_hourly_hour": { - "name": "idx_observation_rollup_hourly_hour", - "columns": [ - { - "expression": "hour_utc", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "observation_rollup_hourly_series_fk": { - "name": "observation_rollup_hourly_series_fk", - "tableFrom": "observation_rollup_hourly", - "columnsFrom": [ - "series_id" - ], - "tableTo": "observation_latest", - "schemaTo": "conditions", - "columnsTo": [ - "series_id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "observation_rollup_hourly_series_id_hour_utc_pk": { - "name": "observation_rollup_hourly_series_id_hour_utc_pk", - "columns": [ - "series_id", - "hour_utc" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_rollup_progress": { - "name": "observation_rollup_progress", - "schema": "conditions", - "columns": { - "period": { - "name": "period", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "finalized_before": { - "name": "finalized_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.raw_payload": { - "name": "raw_payload", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url_key": { - "name": "url_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetch_id": { - "name": "fetch_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "media_type": { - "name": "media_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "bytes_raw": { - "name": "bytes_raw", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "bytes_stored": { - "name": "bytes_stored", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "first_fetched_at": { - "name": "first_fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_seen_at": { - "name": "last_seen_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_count": { - "name": "seen_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "pinned_reason": { - "name": "pinned_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "storage_key": { - "name": "storage_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "base_hash": { - "name": "base_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evicted_at": { - "name": "evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_raw_payload_source_time": { - "name": "idx_raw_payload_source_time", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "first_fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_raw_payload_tier_seen": { - "name": "idx_raw_payload_tier_seen", - "columns": [ - { - "expression": "tier", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_seen_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"raw_payload\".\"evicted_at\" IS NULL", - "concurrently": false - }, - "idx_raw_payload_base": { - "name": "idx_raw_payload_base", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "base_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"raw_payload\".\"base_hash\" IS NOT NULL", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "raw_payload_pk": { - "name": "raw_payload_pk", - "columns": [ - "source_id", - "hash" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "raw_payload_tier_enum": { - "name": "raw_payload_tier_enum", - "value": "\"tier\" IN ('situation', 'observation', 'reference', 'hot')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature": { - "name": "feature", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_geom": { - "name": "idx_feature_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_feature_kind_type": { - "name": "idx_feature_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_source": { - "name": "idx_feature_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_canonical": { - "name": "idx_feature_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_kind_lifecycle": { - "name": "idx_feature_kind_lifecycle", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "lifecycle", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_external_ids": { - "name": "idx_feature_external_ids", - "columns": [ - { - "expression": "(\"record\" -> 'externalIds') jsonb_path_ops", - "isExpression": true, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": { - "fastupdate": "off" - }, - "method": "gin", - "concurrently": false - }, - "idx_feature_rights_revoked": { - "name": "idx_feature_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"feature\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false - }, - "idx_feature_id_bytes": { - "name": "idx_feature_id_bytes", - "columns": [ - { - "expression": "\"id\" COLLATE \"C\"", - "isExpression": true, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_temporality_enum": { - "name": "feature_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "feature_origin_enum": { - "name": "feature_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "feature_access_mode_enum": { - "name": "feature_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "feature_privacy_class_enum": { - "name": "feature_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "feature_tombstone_reason_enum": { - "name": "feature_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "feature_tombstone_complete": { - "name": "feature_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "feature_revision_positive": { - "name": "feature_revision_positive", - "value": "revision > 0" - }, - "feature_lifecycle_enum": { - "name": "feature_lifecycle_enum", - "value": "\"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_canonical": { - "name": "feature_canonical", - "schema": "conditions", - "columns": { - "canonical_feature_id": { - "name": "canonical_feature_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "survivor_id": { - "name": "survivor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "member_ids": { - "name": "member_ids", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "merged_sources": { - "name": "merged_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "components": { - "name": "components", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_canonical_members": { - "name": "idx_feature_canonical_members", - "columns": [ - { - "expression": "member_ids", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": { - "fastupdate": "off" - }, - "method": "gin", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.feature_component": { - "name": "feature_component", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_key": { - "name": "parent_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "lifecycle": { - "name": "lifecycle", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "geometry(Point, 4326)", - "primaryKey": false, - "notNull": false - }, - "external_ids": { - "name": "external_ids", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "details": { - "name": "details", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_component_kind": { - "name": "idx_feature_component_kind", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_feature_component_external_ids": { - "name": "idx_feature_component_external_ids", - "columns": [ - { - "expression": "external_ids", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_path_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "gin", - "concurrently": false - } - }, - "foreignKeys": { - "feature_component_feature_id_feature_id_fk": { - "name": "feature_component_feature_id_feature_id_fk", - "tableFrom": "feature_component", - "columnsFrom": [ - "feature_id" - ], - "tableTo": "feature", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "feature_component_feature_id_key_pk": { - "name": "feature_component_feature_id_key_pk", - "columns": [ - "feature_id", - "key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_component_lifecycle_enum": { - "name": "feature_component_lifecycle_enum", - "value": "lifecycle IS NULL OR \"lifecycle\" IN ('planned', 'under_construction', 'operational', 'temporarily_closed', 'decommissioned', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_link": { - "name": "feature_link", - "schema": "conditions", - "columns": { - "a_id": { - "name": "a_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "b_id": { - "name": "b_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "decided_by": { - "name": "decided_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_link_b": { - "name": "idx_feature_link_b", - "columns": [ - { - "expression": "b_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "feature_link_a_id_b_id_pk": { - "name": "feature_link_a_id_b_id_pk", - "columns": [ - "a_id", - "b_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "feature_link_ordered": { - "name": "feature_link_ordered", - "value": "\"conditions\".\"feature_link\".\"a_id\" < \"conditions\".\"feature_link\".\"b_id\" COLLATE \"C\"" - }, - "feature_link_method_enum": { - "name": "feature_link_method_enum", - "value": "\"method\" IN ('external_id', 'spatial_attribute', 'manual')" - }, - "feature_link_status_enum": { - "name": "feature_link_status_enum", - "value": "\"status\" IN ('accepted', 'rejected', 'pending')" - } - }, - "isRLSEnabled": false - }, - "conditions.feature_revision": { - "name": "feature_revision", - "schema": "conditions", - "columns": { - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_feature_revision_recorded": { - "name": "idx_feature_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "feature_revision_feature_id_feature_id_fk": { - "name": "feature_revision_feature_id_feature_id_fk", - "tableFrom": "feature_revision", - "columnsFrom": [ - "feature_id" - ], - "tableTo": "feature", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "feature_revision_feature_id_revision_pk": { - "name": "feature_revision_feature_id_revision_pk", - "columns": [ - "feature_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.offer": { - "name": "offer", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "subject_class": { - "name": "subject_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "subject_id": { - "name": "subject_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "min_price": { - "name": "min_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - }, - "max_price": { - "name": "max_price", - "type": "numeric(14, 4)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_offer_subject": { - "name": "idx_offer_subject", - "columns": [ - { - "expression": "subject_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "component_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_kind_valid_to": { - "name": "idx_offer_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_geom": { - "name": "idx_offer_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_offer_source": { - "name": "idx_offer_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_canonical": { - "name": "idx_offer_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_offer_rights_revoked": { - "name": "idx_offer_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"offer\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false - }, - "idx_offer_id_bytes": { - "name": "idx_offer_id_bytes", - "columns": [ - { - "expression": "\"id\" COLLATE \"C\"", - "isExpression": true, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "offer_temporality_enum": { - "name": "offer_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "offer_origin_enum": { - "name": "offer_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "offer_access_mode_enum": { - "name": "offer_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "offer_privacy_class_enum": { - "name": "offer_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "offer_tombstone_reason_enum": { - "name": "offer_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "offer_tombstone_complete": { - "name": "offer_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "offer_revision_positive": { - "name": "offer_revision_positive", - "value": "revision > 0" - }, - "offer_subject_class_enum": { - "name": "offer_subject_class_enum", - "value": "\"subject_class\" IN ('feature', 'situation', 'observation', 'offer')" - } - }, - "isRLSEnabled": false - }, - "conditions.offer_revision": { - "name": "offer_revision", - "schema": "conditions", - "columns": { - "offer_id": { - "name": "offer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_offer_revision_recorded": { - "name": "idx_offer_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "offer_revision_offer_id_offer_id_fk": { - "name": "offer_revision_offer_id_offer_id_fk", - "tableFrom": "offer_revision", - "columnsFrom": [ - "offer_id" - ], - "tableTo": "offer", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "offer_revision_offer_id_revision_pk": { - "name": "offer_revision_offer_id_revision_pk", - "columns": [ - "offer_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.record_relation": { - "name": "record_relation", - "schema": "conditions", - "columns": { - "from_class": { - "name": "from_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "from_id": { - "name": "from_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "relation": { - "name": "relation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_class": { - "name": "to_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "to_id": { - "name": "to_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "component_key": { - "name": "component_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "idx_record_relation_to": { - "name": "idx_record_relation_to", - "columns": [ - { - "expression": "to_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "to_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "record_relation_pk": { - "name": "record_relation_pk", - "columns": [ - "from_class", - "from_id", - "relation", - "to_class", - "to_id", - "component_key" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "record_relation_from_class_enum": { - "name": "record_relation_from_class_enum", - "value": "\"from_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_to_class_enum": { - "name": "record_relation_to_class_enum", - "value": "\"to_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "record_relation_relation_enum": { - "name": "record_relation_relation_enum", - "value": "\"relation\" IN ('part_of', 'monitors', 'controls', 'serves', 'group', 'next_occurrence', 'first_occurrence', 'related_work_zone', 'caused_by', 'detour_for', 'supersedes', 'update_of', 'cancels', 'related')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation": { - "name": "situation", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "record": { - "name": "record", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subtype": { - "name": "subtype", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "temporality": { - "name": "temporality", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_record_id": { - "name": "source_record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "origin": { - "name": "origin", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "privacy_class": { - "name": "privacy_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "instance_id": { - "name": "instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "severity": { - "name": "severity", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "severity_level": { - "name": "severity_level", - "type": "smallint", - "primaryKey": false, - "notNull": false - }, - "certainty": { - "name": "certainty", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "planned": { - "name": "planned", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "validity_status": { - "name": "validity_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evidence_state": { - "name": "evidence_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "confidence_score": { - "name": "confidence_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "routing_eligible": { - "name": "routing_eligible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "corroborations": { - "name": "corroborations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_at": { - "name": "flagged_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_situation_geom": { - "name": "idx_situation_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_situation_kind_type": { - "name": "idx_situation_kind_type", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_source": { - "name": "idx_situation_source", - "columns": [ - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_canonical": { - "name": "idx_situation_canonical", - "columns": [ - { - "expression": "canonical_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_valid_to": { - "name": "idx_situation_valid_to", - "columns": [ - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_expires": { - "name": "idx_situation_expires", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_group": { - "name": "idx_situation_group", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_crowd_evidence": { - "name": "idx_situation_crowd_evidence", - "columns": [ - { - "expression": "origin", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "evidence_state", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"situation\".\"origin\" = 'crowd'", - "concurrently": false - }, - "idx_situation_tombstoned": { - "name": "idx_situation_tombstoned", - "columns": [ - { - "expression": "tombstoned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"situation\".\"tombstoned_at\" IS NOT NULL", - "concurrently": false - }, - "idx_situation_rights_revoked": { - "name": "idx_situation_rights_revoked", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"situation\".\"tombstone_reason\" = 'rights_revoked'", - "concurrently": false - }, - "idx_situation_id_bytes": { - "name": "idx_situation_id_bytes", - "columns": [ - { - "expression": "\"id\" COLLATE \"C\"", - "isExpression": true, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_temporality_enum": { - "name": "situation_temporality_enum", - "value": "\"temporality\" IN ('static', 'scheduled', 'live', 'forecast')" - }, - "situation_origin_enum": { - "name": "situation_origin_enum", - "value": "\"origin\" IN ('feed', 'crowd', 'federation', 'derived')" - }, - "situation_access_mode_enum": { - "name": "situation_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "situation_privacy_class_enum": { - "name": "situation_privacy_class_enum", - "value": "\"privacy_class\" IN ('authoritative', 'aggregate', 'k_anon', 'dp_noised', 'crowd_pseudonym')" - }, - "situation_tombstone_reason_enum": { - "name": "situation_tombstone_reason_enum", - "value": "tombstone_reason IS NULL OR \"tombstone_reason\" IN ('expired', 'withdrawn', 'superseded', 'cancelled', 'rights_revoked', 'rejected')" - }, - "situation_tombstone_complete": { - "name": "situation_tombstone_complete", - "value": "(tombstone_reason IS NULL) = (tombstoned_at IS NULL)" - }, - "situation_revision_positive": { - "name": "situation_revision_positive", - "value": "revision > 0" - }, - "situation_severity_enum": { - "name": "situation_severity_enum", - "value": "\"severity\" IN ('none', 'minor', 'moderate', 'major', 'critical', 'unknown')" - }, - "situation_severity_level_range": { - "name": "situation_severity_level_range", - "value": "\"conditions\".\"situation\".\"severity_level\" IS NULL OR \"conditions\".\"situation\".\"severity_level\" BETWEEN 1 AND 5" - }, - "situation_certainty_enum": { - "name": "situation_certainty_enum", - "value": "\"certainty\" IN ('observed', 'likely', 'possible', 'unlikely', 'unknown')" - }, - "situation_validity_status_enum": { - "name": "situation_validity_status_enum", - "value": "\"validity_status\" IN ('planned', 'active', 'suspended', 'ended', 'cancelled', 'unknown')" - }, - "situation_evidence_state_enum": { - "name": "situation_evidence_state_enum", - "value": "evidence_state IS NULL OR \"evidence_state\" IN ('self_reported', 'corroborated', 'externally_resolved', 'negated', 'expired')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_effect": { - "name": "situation_effect", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "effect_id": { - "name": "effect_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "phase_id": { - "name": "phase_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "applicability_kind": { - "name": "applicability_kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "normalization": { - "name": "normalization", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "compliance": { - "name": "compliance", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "direction": { - "name": "direction", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "valid_from": { - "name": "valid_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "valid_to": { - "name": "valid_to", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": false - }, - "value": { - "name": "value", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_effect_kind_valid_to": { - "name": "idx_situation_effect_kind_valid_to", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "valid_to", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_situation_effect_geom": { - "name": "idx_situation_effect_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - } - }, - "foreignKeys": { - "situation_effect_situation_id_situation_id_fk": { - "name": "situation_effect_situation_id_situation_id_fk", - "tableFrom": "situation_effect", - "columnsFrom": [ - "situation_id" - ], - "tableTo": "situation", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "situation_effect_situation_id_effect_id_pk": { - "name": "situation_effect_situation_id_effect_id_pk", - "columns": [ - "situation_id", - "effect_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "situation_effect_applicability_enum": { - "name": "situation_effect_applicability_enum", - "value": "\"applicability_kind\" IN ('all', 'classes', 'unknown')" - }, - "situation_effect_normalization_enum": { - "name": "situation_effect_normalization_enum", - "value": "\"normalization\" IN ('complete', 'partial', 'unsupported')" - }, - "situation_effect_compliance_enum": { - "name": "situation_effect_compliance_enum", - "value": "\"compliance\" IN ('mandatory', 'advisory', 'unknown')" - } - }, - "isRLSEnabled": false - }, - "conditions.situation_revision": { - "name": "situation_revision", - "schema": "conditions", - "columns": { - "situation_id": { - "name": "situation_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "recorded_at": { - "name": "recorded_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "change_kinds": { - "name": "change_kinds", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_situation_revision_recorded": { - "name": "idx_situation_revision_recorded", - "columns": [ - { - "expression": "recorded_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "situation_revision_situation_id_situation_id_fk": { - "name": "situation_revision_situation_id_situation_id_fk", - "tableFrom": "situation_revision", - "columnsFrom": [ - "situation_id" - ], - "tableTo": "situation", - "schemaTo": "conditions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "situation_revision_situation_id_revision_pk": { - "name": "situation_revision_situation_id_revision_pk", - "columns": [ - "situation_id", - "revision" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_erasure": { - "name": "archive_erasure", - "schema": "conditions", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "applied_at": { - "name": "applied_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.archive_file": { - "name": "archive_file", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "file_name": { - "name": "file_name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sha256": { - "name": "sha256", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "bytes": { - "name": "bytes", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "built_at": { - "name": "built_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.block_list": { - "name": "block_list", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_blocklist": { - "name": "federation_blocklist", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_instance_key": { - "name": "federation_instance_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "multibase": { - "name": "multibase", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "endorsed_by": { - "name": "endorsed_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "endorsement": { - "name": "endorsement", - "type": "bytea", - "primaryKey": false, - "notNull": false - }, - "endorsement_proof": { - "name": "endorsement_proof", - "type": "bytea", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_journal": { - "name": "federation_journal", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "epoch": { - "name": "epoch", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "started_at": { - "name": "started_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "seen_xid": { - "name": "seen_xid", - "type": "xid8", - "primaryKey": false, - "notNull": true - }, - "timeline_id": { - "name": "timeline_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "database_oid": { - "name": "database_oid", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "system_identifier": { - "name": "system_identifier", - "type": "bigint", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_journal_single_row": { - "name": "federation_journal_single_row", - "value": "\"conditions\".\"federation_journal\".\"singleton\"" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_lapsed_copy": { - "name": "federation_lapsed_copy", - "schema": "conditions", - "columns": { - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "lapsed_at": { - "name": "lapsed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_federation_lapsed_copy_source": { - "name": "idx_federation_lapsed_copy_source", - "columns": [ - { - "expression": "peer_instance_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "source_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_lapsed_copy_record_class_record_id_pk": { - "name": "federation_lapsed_copy_record_class_record_id_pk", - "columns": [ - "record_class", - "record_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_outbox": { - "name": "federation_outbox", - "schema": "conditions", - "columns": { - "seq": { - "name": "seq", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_class": { - "name": "record_class", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "record_id": { - "name": "record_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "priority": { - "name": "priority", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "snapshot": { - "name": "snapshot", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "tombstone_reason": { - "name": "tombstone_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "txid": { - "name": "txid", - "type": "xid8", - "primaryKey": false, - "notNull": true, - "default": "pg_current_xact_id()" - } - }, - "indexes": { - "idx_federation_outbox_record": { - "name": "idx_federation_outbox_record", - "columns": [ - { - "expression": "record_class", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "record_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_federation_outbox_cursor": { - "name": "idx_federation_outbox_cursor", - "columns": [ - { - "expression": "txid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "seq", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_federation_outbox_created_at": { - "name": "idx_federation_outbox_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_outbox_operation_enum": { - "name": "federation_outbox_operation_enum", - "value": "\"conditions\".\"federation_outbox\".\"operation\" IN ('create','update','delete','liveness')" - }, - "federation_outbox_record_class_enum": { - "name": "federation_outbox_record_class_enum", - "value": "\"record_class\" IN ('feature', 'situation', 'observation', 'offer')" - }, - "federation_outbox_delete_shape": { - "name": "federation_outbox_delete_shape", - "value": "(\"conditions\".\"federation_outbox\".\"operation\" = 'delete') = (\"conditions\".\"federation_outbox\".\"snapshot\" IS NULL AND \"conditions\".\"federation_outbox\".\"tombstone_reason\" IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_peer_capabilities": { - "name": "federation_peer_capabilities", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "schema_versions": { - "name": "schema_versions", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "protocol_version": { - "name": "protocol_version", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_cursor": { - "name": "federation_peer_cursor", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "archive_built_at": { - "name": "archive_built_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "archive_landed_at": { - "name": "archive_landed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "journal_epoch": { - "name": "journal_epoch", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor_reset_at": { - "name": "cursor_reset_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "reconcile_due_since": { - "name": "reconcile_due_since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "reconcile_class": { - "name": "reconcile_class", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reconcile_after": { - "name": "reconcile_after", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reconciled_at": { - "name": "reconciled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_health": { - "name": "federation_peer_health", - "schema": "conditions", - "columns": { - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "availability_ok": { - "name": "availability_ok", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "availability_fail": { - "name": "availability_fail", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "signature_failures": { - "name": "signature_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "replay_failures": { - "name": "replay_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "schema_failures": { - "name": "schema_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "rate_violations": { - "name": "rate_violations", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "effective_tier_until": { - "name": "effective_tier_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_peer_key": { - "name": "federation_peer_key", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "anchor": { - "name": "anchor", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "learned_at": { - "name": "learned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_peer_key_peer_instance_id_key_id_pk": { - "name": "federation_peer_key_peer_instance_id_key_id_pk", - "columns": [ - "peer_instance_id", - "key_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_source_receipt": { - "name": "federation_source_receipt", - "schema": "conditions", - "columns": { - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "last_received_at": { - "name": "last_received_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "liveness_at": { - "name": "liveness_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_source_receipt_peer_instance_id_source_id_pk": { - "name": "federation_source_receipt_peer_instance_id_source_id_pk", - "columns": [ - "peer_instance_id", - "source_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.federation_subscription": { - "name": "federation_subscription", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "peer_id": { - "name": "peer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filter": { - "name": "filter", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "delivery_mode": { - "name": "delivery_mode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pull'" - }, - "inbox_url": { - "name": "inbox_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cursor": { - "name": "cursor", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'0.0'" - }, - "priority_only": { - "name": "priority_only", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "push_failures": { - "name": "push_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "revision": { - "name": "revision", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now() + interval '30 days'" - } - }, - "indexes": { - "idx_federation_subscription_peer": { - "name": "idx_federation_subscription_peer", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "uq_federation_subscription_target": { - "name": "uq_federation_subscription_target", - "columns": [ - { - "expression": "peer_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "delivery_mode", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "coalesce(\"inbox_url\", '')", - "isExpression": true, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "where": "\"conditions\".\"federation_subscription\".\"delivery_mode\" <> 'sse'", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "federation_subscription_delivery_mode_enum": { - "name": "federation_subscription_delivery_mode_enum", - "value": "\"conditions\".\"federation_subscription\".\"delivery_mode\" IN ('pull','webhook','sse')" - } - }, - "isRLSEnabled": false - }, - "conditions.federation_tombstone": { - "name": "federation_tombstone", - "schema": "conditions", - "columns": { - "canonical_id": { - "name": "canonical_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "peer_instance_id": { - "name": "peer_instance_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tombstoned_at": { - "name": "tombstoned_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "federation_tombstone_canonical_id_peer_instance_id_pk": { - "name": "federation_tombstone_canonical_id_peer_instance_id_pk", - "columns": [ - "canonical_id", - "peer_instance_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.geonet_coverage": { - "name": "geonet_coverage", - "schema": "conditions", - "columns": { - "revisions": { - "name": "revisions", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "covered_from": { - "name": "covered_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "covered_until": { - "name": "covered_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.issuer_key": { - "name": "issuer_key", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "public_key": { - "name": "public_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "private_key": { - "name": "private_key", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "not_before": { - "name": "not_before", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "not_after": { - "name": "not_after", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.nsw_rfs_clock": { - "name": "nsw_rfs_clock", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "incident_id": { - "name": "incident_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sent": { - "name": "sent", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expiry": { - "name": "expiry", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "nsw_rfs_clock_source_id_incident_id_pk": { - "name": "nsw_rfs_clock_source_id_incident_id_pk", - "columns": [ - "source_id", - "incident_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.observation_revision": { - "name": "observation_revision", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "feature_id": { - "name": "feature_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "property": { - "name": "property", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "measured_at": { - "name": "measured_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "rank": { - "name": "rank", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "suppressed": { - "name": "suppressed", - "type": "boolean", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "observation_revision_source_id_feature_id_property_pk": { - "name": "observation_revision_source_id_feature_id_property_pk", - "columns": [ - "source_id", - "feature_id", - "property" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.on_demand_fetch": { - "name": "on_demand_fetch", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "cell": { - "name": "cell", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "retry_at": { - "name": "retry_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "claimed_until": { - "name": "claimed_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "on_demand_fetch_source_id_cell_pk": { - "name": "on_demand_fetch_source_id_cell_pk", - "columns": [ - "source_id", - "cell" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "on_demand_fetch_status_enum": { - "name": "on_demand_fetch_status_enum", - "value": "\"conditions\".\"on_demand_fetch\".\"status\" IN ('pending','fresh','failed')" - } - }, - "isRLSEnabled": false - }, - "conditions.on_demand_quota": { - "name": "on_demand_quota", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "tokens": { - "name": "tokens", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "refilled_at": { - "name": "refilled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "day": { - "name": "day", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "day_count": { - "name": "day_count", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.osm_road": { - "name": "osm_road", - "schema": "conditions", - "columns": { - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": true, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "oneway": { - "name": "oneway", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "oneway_reversed": { - "name": "oneway_reversed", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxspeed_kph": { - "name": "maxspeed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "region": { - "name": "region", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "import_config_hash": { - "name": "import_config_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "import_provenance": { - "name": "import_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_osm_road_geom": { - "name": "idx_osm_road_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_osm_road_highway": { - "name": "idx_osm_road_highway", - "columns": [ - { - "expression": "highway", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_osm_road_ref": { - "name": "idx_osm_road_ref", - "columns": [ - { - "expression": "ref", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.public_license_policy": { - "name": "public_license_policy", - "schema": "conditions", - "columns": { - "license": { - "name": "license", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.reporter": { - "name": "reporter", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "pub_jwk": { - "name": "pub_jwk", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "osm_uid": { - "name": "osm_uid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_lookup_hmac": { - "name": "email_lookup_hmac", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "reputation_alpha": { - "name": "reputation_alpha", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "reputation_beta": { - "name": "reputation_beta", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "corroborated_count": { - "name": "corroborated_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "flagged_count": { - "name": "flagged_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "trust_signal": { - "name": "trust_signal", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "entitlement_expires_at": { - "name": "entitlement_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_active_at": { - "name": "last_active_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "reporter_reputation_alpha_positive": { - "name": "reporter_reputation_alpha_positive", - "value": "\"conditions\".\"reporter\".\"reputation_alpha\" > 0" - }, - "reporter_reputation_beta_positive": { - "name": "reporter_reputation_beta_positive", - "value": "\"conditions\".\"reporter\".\"reputation_beta\" > 0" - }, - "reporter_status_enum": { - "name": "reporter_status_enum", - "value": "\"conditions\".\"reporter\".\"status\" IN ('active','blocked')" - } - }, - "isRLSEnabled": false - }, - "conditions.road_graph_state": { - "name": "road_graph_state", - "schema": "conditions", - "columns": { - "singleton": { - "name": "singleton", - "type": "boolean", - "primaryKey": true, - "notNull": true, - "default": true - }, - "generation": { - "name": "generation", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'ready'" - }, - "regions": { - "name": "regions", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "highway_classes": { - "name": "highway_classes", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "pbf_provenance": { - "name": "pbf_provenance", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "imported_at": { - "name": "imported_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "activated_at": { - "name": "activated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "road_graph_state_singleton": { - "name": "road_graph_state_singleton", - "value": "\"conditions\".\"road_graph_state\".\"singleton\" IS TRUE" - } - }, - "isRLSEnabled": false - }, - "conditions.road_segment": { - "name": "road_segment", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "way_id": { - "name": "way_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "dir": { - "name": "dir", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "geom": { - "name": "geom", - "type": "geometry(Geometry, 4326)", - "primaryKey": false, - "notNull": true - }, - "highway": { - "name": "highway", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ref": { - "name": "ref", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "length_m": { - "name": "length_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "min_zoom": { - "name": "min_zoom", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "openlr": { - "name": "openlr", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_road_segment_geom": { - "name": "idx_road_segment_geom", - "columns": [ - { - "expression": "geom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - }, - "idx_road_segment_way": { - "name": "idx_road_segment_way", - "columns": [ - { - "expression": "way_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_road_segment_minzoom": { - "name": "idx_road_segment_minzoom", - "columns": [ - { - "expression": "min_zoom", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_observation": { - "name": "segment_observation", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_segment_observation_segment": { - "name": "idx_segment_observation_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_observation_segment_id_source_pk": { - "name": "segment_observation_segment_id_source_pk", - "columns": [ - "segment_id", - "source" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_profile": { - "name": "segment_profile", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow": { - "name": "dow", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_hour": { - "name": "tod_hour", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "speed_kph": { - "name": "speed_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_profile_segment": { - "name": "idx_segment_profile_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "segment_profile_segment_id_dow_tod_hour_pk": { - "name": "segment_profile_segment_id_dow_tod_hour_pk", - "columns": [ - "segment_id", - "dow", - "tod_hour" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.segment_speed": { - "name": "segment_speed", - "schema": "conditions", - "columns": { - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "current_kph": { - "name": "current_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "speed_ratio": { - "name": "speed_ratio", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "los": { - "name": "los", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "confidence": { - "name": "confidence", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source_tier": { - "name": "source_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "is_estimated": { - "name": "is_estimated", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "native_field_sources": { - "name": "native_field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_sources": { - "name": "field_sources", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_contributors": { - "name": "field_contributors", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "field_lineage_complete": { - "name": "field_lineage_complete", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "observed_at": { - "name": "observed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_segment_speed_los": { - "name": "idx_segment_speed_los", - "columns": [ - { - "expression": "los", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_baseline": { - "name": "sensor_baseline", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "dow_bucket": { - "name": "dow_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "tod_bucket": { - "name": "tod_bucket", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "free_flow_kph": { - "name": "free_flow_kph", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "contributor_receipt_ids": { - "name": "contributor_receipt_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "lineage_complete": { - "name": "lineage_complete", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "permission_licenses": { - "name": "permission_licenses", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "contributing": { - "name": "contributing", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "sample_count": { - "name": "sample_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "computed_at": { - "name": "computed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_baseline_source_bucket": { - "name": "idx_sensor_baseline_source_bucket", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dow_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "tod_bucket", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk": { - "name": "sensor_baseline_subject_key_dow_bucket_tod_bucket_method_pk", - "columns": [ - "subject_key", - "dow_bucket", - "tod_bucket", - "method" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.sensor_segment": { - "name": "sensor_segment", - "schema": "conditions", - "columns": { - "subject_key": { - "name": "subject_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "segment_id": { - "name": "segment_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "fraction": { - "name": "fraction", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "offset_m": { - "name": "offset_m", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "bearing_deg": { - "name": "bearing_deg", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "matched_at": { - "name": "matched_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sensor_segment_segment": { - "name": "idx_sensor_segment_segment", - "columns": [ - { - "expression": "segment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.smn_cap_decision": { - "name": "smn_cap_decision", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "decided_at": { - "name": "decided_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "decision": { - "name": "decision", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.smn_cap_message": { - "name": "smn_cap_message", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "identifier": { - "name": "identifier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "variant": { - "name": "variant", - "type": "text", - "primaryKey": false, - "notNull": true, - "generated": { - "type": "stored", - "as": "encode(sha256(body), 'hex')" - } - }, - "retrieval": { - "name": "retrieval", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{\"legacy\":true}'::jsonb" - }, - "body": { - "name": "body", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "retain_until": { - "name": "retain_until", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "smn_cap_message_source_id_variant_pk": { - "name": "smn_cap_message_source_id_variant_pk", - "columns": [ - "source_id", - "variant" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_poll_attempt": { - "name": "source_poll_attempt", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempted_at": { - "name": "attempted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "finished_at": { - "name": "finished_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "outcome": { - "name": "outcome", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "network_validated": { - "name": "network_validated", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "inserted": { - "name": "inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "updated": { - "name": "updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "deleted": { - "name": "deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "rejected": { - "name": "rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_succeeded": { - "name": "partitions_succeeded", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_failed": { - "name": "partitions_failed", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "partitions_total": { - "name": "partitions_total", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "payload_hashes": { - "name": "payload_hashes", - "type": "text[]", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_source_poll_attempt_source_time": { - "name": "idx_source_poll_attempt_source_time", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_source_poll_attempt_time": { - "name": "idx_source_poll_attempt_time", - "columns": [ - { - "expression": "attempted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source_shrink": { - "name": "source_shrink", - "schema": "conditions", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "since": { - "name": "since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "polls": { - "name": "polls", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "stated": { - "name": "stated", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "held": { - "name": "held", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "source_shrink_source_id_scope_pk": { - "name": "source_shrink_source_id_scope_pk", - "columns": [ - "source_id", - "scope" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_shrink_scope_enum": { - "name": "source_shrink_scope_enum", - "value": "\"conditions\".\"source_shrink\".\"scope\" IN ('series','records')" - } - }, - "isRLSEnabled": false - }, - "conditions.source_status": { - "name": "source_status", - "schema": "conditions", - "columns": { - "source": { - "name": "source", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "last_attempt_at": { - "name": "last_attempt_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_success_at": { - "name": "last_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_network_success_at": { - "name": "last_network_success_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "freshness_deadline": { - "name": "freshness_deadline", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "source_published_at": { - "name": "source_published_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_publication_at": { - "name": "last_publication_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publication_revision": { - "name": "publication_revision", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_outcome": { - "name": "last_outcome", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "last_row_count": { - "name": "last_row_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "active_event_count": { - "name": "active_event_count", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_inserted": { - "name": "last_inserted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_updated": { - "name": "last_updated", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_deleted": { - "name": "last_deleted", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_rejected": { - "name": "last_rejected", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_duration_ms": { - "name": "last_duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "consecutive_failures": { - "name": "consecutive_failures", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "raw_hot_evicted_at": { - "name": "raw_hot_evicted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.spent_token": { - "name": "spent_token", - "schema": "conditions", - "columns": { - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "spent_at": { - "name": "spent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_spent_token_spent_at": { - "name": "idx_spent_token_spent_at", - "columns": [ - { - "expression": "spent_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.token_quota": { - "name": "token_quota", - "schema": "conditions", - "columns": { - "key_id": { - "name": "key_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "epoch": { - "name": "epoch", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "issued": { - "name": "issued", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "token_quota_key_id_epoch_pk": { - "name": "token_quota_key_id_epoch_pk", - "columns": [ - "key_id", - "epoch" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.oauth_grant": { - "name": "oauth_grant", - "schema": "conditions", - "columns": { - "grant_key": { - "name": "grant_key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_issued_at": { - "name": "refresh_issued_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_expires_at": { - "name": "access_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "rejected_at": { - "name": "rejected_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_error": { - "name": "last_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_error_at": { - "name": "last_error_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "conditions.source": { - "name": "source", - "schema": "conditions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "product": { - "name": "product", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "access_mode": { - "name": "access_mode", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "country": { - "name": "country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "subdivision": { - "name": "subdivision", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "operator": { - "name": "operator", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license": { - "name": "license", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "license_url": { - "name": "license_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "attribution": { - "name": "attribution", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "credit_name": { - "name": "credit_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_url": { - "name": "credit_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "credit_notice": { - "name": "credit_notice", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "rights": { - "name": "rights", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "restricted": { - "name": "restricted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restricted_since": { - "name": "restricted_since", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "fusion_restricted": { - "name": "fusion_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "fusion_tier": { - "name": "fusion_tier", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "fusion_licenses": { - "name": "fusion_licenses", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "federation_restricted": { - "name": "federation_restricted", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "federation_pending": { - "name": "federation_pending", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "cadence_sec": { - "name": "cadence_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "freshness_window_sec": { - "name": "freshness_window_sec", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "raw_retention": { - "name": "raw_retention", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "extras_allow": { - "name": "extras_allow", - "type": "text[]", - "primaryKey": false, - "notNull": true, - "default": "'{}'::text[]" - }, - "extras_federate": { - "name": "extras_federate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "lane_numbering": { - "name": "lane_numbering", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "parent_source_id": { - "name": "parent_source_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "policy_ids": { - "name": "policy_ids", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "selection_state": { - "name": "selection_state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "active": { - "name": "active", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": { - "source_access_mode_enum": { - "name": "source_access_mode_enum", - "value": "\"access_mode\" IN ('bulk', 'on_demand')" - }, - "source_tier_enum": { - "name": "source_tier_enum", - "value": "\"tier\" IN ('authoritative', 'operator', 'aggregator', 'community')" - } - }, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "views": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/core/drizzle/meta/_journal.json b/packages/core/drizzle/meta/_journal.json index 794f47666..44932de0c 100644 --- a/packages/core/drizzle/meta/_journal.json +++ b/packages/core/drizzle/meta/_journal.json @@ -5,750 +5,15 @@ { "idx": 0, "version": "7", - "when": 1782170564246, - "tag": "0000_init_conditions_observations", + "when": 1795502606552, + "tag": "0000_baseline", "breakpoints": true }, { "idx": 1, "version": "7", - "when": 1782247279180, - "tag": "0001_add_label", - "breakpoints": true - }, - { - "idx": 2, - "version": "7", - "when": 1783003324994, - "tag": "0002_sensor_baseline_and_speed_sample", - "breakpoints": true - }, - { - "idx": 3, - "version": "7", - "when": 1783543441977, - "tag": "0003_source_status_and_content_hash", - "breakpoints": true - }, - { - "idx": 4, - "version": "7", - "when": 1783594649129, - "tag": "0004_segment_spine", - "breakpoints": true - }, - { - "idx": 5, - "version": "7", - "when": 1783600395617, - "tag": "0005_segment_observation_speed", - "breakpoints": true - }, - { - "idx": 6, - "version": "7", - "when": 1783622960089, - "tag": "0006_segment_profile", - "breakpoints": true - }, - { - "idx": 7, - "version": "7", - "when": 1783800245125, - "tag": "0007_commons_observation_fields", - "breakpoints": true - }, - { - "idx": 8, - "version": "7", - "when": 1783824959050, - "tag": "0008_contribution_tables_evidence_state", - "breakpoints": true - }, - { - "idx": 9, - "version": "7", - "when": 1783830137444, - "tag": "0009_spent_token_single_use", - "breakpoints": true - }, - { - "idx": 10, - "version": "7", - "when": 1783847483277, - "tag": "0010_observation_flagged_at", - "breakpoints": true - }, - { - "idx": 11, - "version": "7", - "when": 1783849913343, - "tag": "0011_report_evidence_actor_index", - "breakpoints": true - }, - { - "idx": 12, - "version": "7", - "when": 1783852158954, - "tag": "0012_block_list", - "breakpoints": true - }, - { - "idx": 13, - "version": "7", - "when": 1783909553135, - "tag": "0013_federation_instance_key", - "breakpoints": true - }, - { - "idx": 14, - "version": "7", - "when": 1783914290772, - "tag": "0014_federation_outbox", - "breakpoints": true - }, - { - "idx": 15, - "version": "7", - "when": 1783917124070, - "tag": "0015_federation_outbox_txid_cursor", - "breakpoints": true - }, - { - "idx": 16, - "version": "7", - "when": 1783943638564, - "tag": "0016_federation_subscription", - "breakpoints": true - }, - { - "idx": 17, - "version": "7", - "when": 1783947895746, - "tag": "0017_observation_content_hash_index", - "breakpoints": true - }, - { - "idx": 18, - "version": "7", - "when": 1783951708056, - "tag": "0018_observation_tombstone_reason", - "breakpoints": true - }, - { - "idx": 19, - "version": "7", - "when": 1783953685829, - "tag": "0019_federation_tombstone", - "breakpoints": true - }, - { - "idx": 20, - "version": "7", - "when": 1784056152930, - "tag": "0020_federation_peer_health", - "breakpoints": true - }, - { - "idx": 21, - "version": "7", - "when": 1784113337318, - "tag": "0021_federation_outbox_retention_index", - "breakpoints": true - }, - { - "idx": 22, - "version": "7", - "when": 1784199036072, - "tag": "0022_equal_wonder_man", - "breakpoints": true - }, - { - "idx": 23, - "version": "7", - "when": 1784281542875, - "tag": "0023_gate_federation_outbox_capture", - "breakpoints": true - }, - { - "idx": 24, - "version": "7", - "when": 1784284590315, - "tag": "0024_sensor_speed_hourly_rollup", - "breakpoints": true - }, - { - "idx": 25, - "version": "7", - "when": 1788710067631, - "tag": "0025_observation_binding", - "breakpoints": true - }, - { - "idx": 26, - "version": "7", - "when": 1789126570589, - "tag": "0026_poll_facts", - "breakpoints": true - }, - { - "idx": 27, - "version": "7", - "when": 1789126957750, - "tag": "0027_binding_currency", - "breakpoints": true - }, - { - "idx": 28, - "version": "7", - "when": 1789157357867, - "tag": "0028_segment_flow_function", - "breakpoints": true - }, - { - "idx": 29, - "version": "7", - "when": 1789157372760, - "tag": "0029_tombstone_reason_escalation", - "breakpoints": true - }, - { - "idx": 30, - "version": "7", - "when": 1789157396341, - "tag": "0030_source_poll_retention", - "breakpoints": true - }, - { - "idx": 31, - "version": "7", - "when": 1789160123293, - "tag": "0031_subscription_revisions", - "breakpoints": true - }, - { - "idx": 32, - "version": "7", - "when": 1789160213840, - "tag": "0032_speed_bucket_finalization", - "breakpoints": true - }, - { - "idx": 33, - "version": "7", - "when": 1789160888961, - "tag": "0033_speed_rollup_progress", - "breakpoints": true - }, - { - "idx": 34, - "version": "7", - "when": 1789823911759, - "tag": "0034_poll_attempt_payload_hashes", - "breakpoints": true - }, - { - "idx": 35, - "version": "7", - "when": 1789833004686, - "tag": "0035_kernel_vocabulary_checks", - "breakpoints": true - }, - { - "idx": 36, - "version": "7", - "when": 1790870778058, - "tag": "0036_source_registry", - "breakpoints": true - }, - { - "idx": 37, - "version": "7", - "when": 1790870899773, - "tag": "0037_record_classes", - "breakpoints": true - }, - { - "idx": 38, - "version": "7", - "when": 1790870986607, - "tag": "0038_observation_series", - "breakpoints": true - }, - { - "idx": 39, - "version": "7", - "when": 1790870987380, - "tag": "0039_observation_history", - "breakpoints": true - }, - { - "idx": 40, - "version": "7", - "when": 1790871678626, - "tag": "0040_raw_payloads", - "breakpoints": true - }, - { - "idx": 41, - "version": "7", - "when": 1790871971765, - "tag": "0041_raw_eviction_warning", - "breakpoints": true - }, - { - "idx": 42, - "version": "7", - "when": 1790876175373, - "tag": "0042_record_bindings", - "breakpoints": true - }, - { - "idx": 43, - "version": "7", - "when": 1790901651398, - "tag": "0043_drop_observation_bindings", - "breakpoints": true - }, - { - "idx": 44, - "version": "7", - "when": 1790901659011, - "tag": "0044_record_binding_queue", - "breakpoints": true - }, - { - "idx": 45, - "version": "7", - "when": 1790939862397, - "tag": "0045_crowd_records", - "breakpoints": true - }, - { - "idx": 46, - "version": "7", - "when": 1790942200338, - "tag": "0046_retire_observation_outbox", - "breakpoints": true - }, - { - "idx": 47, - "version": "7", - "when": 1790942244690, - "tag": "0047_record_outbox", - "breakpoints": true - }, - { - "idx": 48, - "version": "7", - "when": 1790942282855, - "tag": "0048_record_outbox_capture", - "breakpoints": true - }, - { - "idx": 49, - "version": "7", - "when": 1790961513279, - "tag": "0049_peer_scoped_erasure", - "breakpoints": true - }, - { - "idx": 50, - "version": "7", - "when": 1790973744599, - "tag": "0050_retire_legacy_flow_tables", - "breakpoints": true - }, - { - "idx": 51, - "version": "7", - "when": 1790975219030, - "tag": "0051_canonical_components_crowd_evidence", - "breakpoints": true - }, - { - "idx": 52, - "version": "7", - "when": 1790975228135, - "tag": "0052_crowd_observations_stay_local", - "breakpoints": true - }, - { - "idx": 53, - "version": "7", - "when": 1791014781023, - "tag": "0053_clear_latest_readings", - "breakpoints": true - }, - { - "idx": 54, - "version": "7", - "when": 1791014786234, - "tag": "0054_compact_latest_readings", - "breakpoints": true - }, - { - "idx": 55, - "version": "7", - "when": 1791014796473, - "tag": "0055_latest_template_out_of_line", - "breakpoints": true - }, - { - "idx": 56, - "version": "7", - "when": 1791015898022, - "tag": "0056_drop_history_time_index", - "breakpoints": true - }, - { - "idx": 57, - "version": "7", - "when": 1791016669268, - "tag": "0057_crowd_record_id", - "breakpoints": true - }, - { - "idx": 58, - "version": "7", - "when": 1791017752997, - "tag": "0058_latest_source_index", - "breakpoints": true - }, - { - "idx": 59, - "version": "7", - "when": 1791033128183, - "tag": "0059_archive_erasure", - "breakpoints": true - }, - { - "idx": 60, - "version": "7", - "when": 1791042150903, - "tag": "0060_feed_catalog", - "breakpoints": true - }, - { - "idx": 61, - "version": "7", - "when": 1791138532682, - "tag": "0061_operator_scope_fusion_federation", - "breakpoints": true - }, - { - "idx": 62, - "version": "7", - "when": 1791138536258, - "tag": "0062_federation_capture", - "breakpoints": true - }, - { - "idx": 63, - "version": "7", - "when": 1791410583238, - "tag": "0063_federation_source_receipt", - "breakpoints": true - }, - { - "idx": 64, - "version": "7", - "when": 1791495550157, - "tag": "0064_observation_latest_effective", - "breakpoints": true - }, - { - "idx": 65, - "version": "7", - "when": 1791648820044, - "tag": "0065_canonical_members_direct", - "breakpoints": true - }, - { - "idx": 66, - "version": "7", - "when": 1791657032323, - "tag": "0066_feature_external_ids_direct", - "breakpoints": true - }, - { - "idx": 67, - "version": "7", - "when": 1791661967593, - "tag": "0067_feature_link_code_point_order", - "breakpoints": true - }, - { - "idx": 68, - "version": "7", - "when": 1791848183068, - "tag": "0068_flow_field_lineage", - "breakpoints": true - }, - { - "idx": 69, - "version": "7", - "when": 1791923904681, - "tag": "0069_captured_licensing", - "breakpoints": true - }, - { - "idx": 70, - "version": "7", - "when": 1792002866127, - "tag": "0070_report_refusal", - "breakpoints": true - }, - { - "idx": 71, - "version": "7", - "when": 1792018481228, - "tag": "0071_rights_revoked_indexes", - "breakpoints": true - }, - { - "idx": 72, - "version": "7", - "when": 1792086616184, - "tag": "0072_observation_upstream_receipts", - "breakpoints": true - }, - { - "idx": 73, - "version": "7", - "when": 1792098279985, - "tag": "0073_federation_source_liveness", - "breakpoints": true - }, - { - "idx": 74, - "version": "7", - "when": 1792098298272, - "tag": "0074_source_shrink", - "breakpoints": true - }, - { - "idx": 75, - "version": "7", - "when": 1792098322063, - "tag": "0075_federation_peer_cursor", - "breakpoints": true - }, - { - "idx": 76, - "version": "7", - "when": 1792098332372, - "tag": "0076_federation_peer_lapse", - "breakpoints": true - }, - { - "idx": 77, - "version": "7", - "when": 1792102704918, - "tag": "0077_captured_attribution_receipts", - "breakpoints": true - }, - { - "idx": 78, - "version": "7", - "when": 1792102744355, - "tag": "0078_captured_attribution_functions", - "breakpoints": true - }, - { - "idx": 79, - "version": "7", - "when": 1792183544332, - "tag": "0079_oauth_grant", - "breakpoints": true - }, - { - "idx": 80, - "version": "7", - "when": 1792273708229, - "tag": "0080_situation_severity_none", - "breakpoints": true - }, - { - "idx": 81, - "version": "7", - "when": 1792697825341, - "tag": "0081_federation_key_endorsement", - "breakpoints": true - }, - { - "idx": 82, - "version": "7", - "when": 1792698299560, - "tag": "0082_federation_single_subscription", - "breakpoints": true - }, - { - "idx": 83, - "version": "7", - "when": 1792698690643, - "tag": "0083_federation_key_anchor", - "breakpoints": true - }, - { - "idx": 84, - "version": "7", - "when": 1792699202715, - "tag": "0084_federation_delete_revision", - "breakpoints": true - }, - { - "idx": 85, - "version": "7", - "when": 1792699203457, - "tag": "0085_federation_journal_delete_revision", - "breakpoints": true - }, - { - "idx": 86, - "version": "7", - "when": 1792700328884, - "tag": "0086_archive_file", - "breakpoints": true - }, - { - "idx": 87, - "version": "7", - "when": 1792700972377, - "tag": "0087_federation_peer_cadence", - "breakpoints": true - }, - { - "idx": 88, - "version": "7", - "when": 1792701448079, - "tag": "0088_federation_archive_landed", - "breakpoints": true - }, - { - "idx": 89, - "version": "7", - "when": 1793316261080, - "tag": "0089_latest_autovacuum", - "breakpoints": true - }, - { - "idx": 90, - "version": "7", - "when": 1793443184221, - "tag": "0090_derived_baseline_overall_only", - "breakpoints": true - }, - { - "idx": 91, - "version": "7", - "when": 1793779843938, - "tag": "0091_compact_latest_identity", - "breakpoints": true - }, - { - "idx": 92, - "version": "7", - "when": 1794013784469, - "tag": "0092_compact_fused_lineage", - "breakpoints": true - }, - { - "idx": 93, - "version": "7", - "when": 1794038400000, - "tag": "0093_source_publication_clock", - "breakpoints": true - }, - { - "idx": 94, - "version": "7", - "when": 1794066703442, - "tag": "0094_smn_cap_message", - "breakpoints": true - }, - { - "idx": 95, - "version": "7", - "when": 1794210853683, - "tag": "0095_glorious_adam_destine", - "breakpoints": true - }, - { - "idx": 96, - "version": "7", - "when": 1794273434226, - "tag": "0096_small_tigra", - "breakpoints": true - }, - { - "idx": 97, - "version": "7", - "when": 1794273434227, - "tag": "0097_geonet_coverage", - "breakpoints": true - }, - { - "idx": 98, - "version": "7", - "when": 1794341624308, - "tag": "0098_observation_revision", - "breakpoints": true - }, - { - "idx": 99, - "version": "7", - "when": 1794341624309, - "tag": "0099_tiresome_frightful_four", - "breakpoints": true - }, - { - "idx": 100, - "version": "7", - "when": 1794341624310, - "tag": "0100_calm_kabuki", - "breakpoints": true - }, - { - "idx": 101, - "version": "7", - "when": 1794869175858, - "tag": "0101_federation_journal_epoch", - "breakpoints": true - }, - { - "idx": 102, - "version": "7", - "when": 1794869800588, - "tag": "0102_federation_subscription_lease", - "breakpoints": true - }, - { - "idx": 103, - "version": "7", - "when": 1794931727225, - "tag": "0103_federation_reconcile", - "breakpoints": true - }, - { - "idx": 104, - "version": "7", - "when": 1794938607378, - "tag": "0104_federation_journal_identity", - "breakpoints": true - }, - { - "idx": 105, - "version": "7", - "when": 1795462944093, - "tag": "0105_osm_oneway_direction", - "breakpoints": true - }, - { - "idx": 106, - "version": "7", - "when": 1795462945855, - "tag": "0106_invalidate_legacy_road_graph", + "when": 1795502607057, + "tag": "0001_database_objects", "breakpoints": true } ] diff --git a/packages/core/src/__tests__/canonical-bbox.integration.test.ts b/packages/core/src/__tests__/canonical-bbox.integration.test.ts index 86c24ada6..7d2c2db20 100644 --- a/packages/core/src/__tests__/canonical-bbox.integration.test.ts +++ b/packages/core/src/__tests__/canonical-bbox.integration.test.ts @@ -78,7 +78,7 @@ describe("canonical view in a box", () => { const nodes = nodesOf(plans![0]!.Plan); // A cluster found by member reads the member index; a member test as a // join filter walks every cluster of the view for each boxed feature. - expect(nodes.some((n) => n["Index Name"] === "idx_feature_canonical_members")).toBe(true); + expect(nodes.some((n) => n["Index Name"] === "feature_canonical_member_ids_idx")).toBe(true); expect(nodes.filter((n) => String(n["Join Filter"] ?? "").includes("member_ids"))).toEqual([]); }); }); diff --git a/packages/core/src/__tests__/grant-consumer-roles.test.ts b/packages/core/src/__tests__/grant-consumer-roles.test.ts new file mode 100644 index 000000000..a75bd3ee8 --- /dev/null +++ b/packages/core/src/__tests__/grant-consumer-roles.test.ts @@ -0,0 +1,48 @@ +import type postgres from "postgres"; +import { describe, expect, it } from "vitest"; +import { grantConsumerRoles } from "../db/migrate.js"; + +/** A client whose queries fail with the given errors in turn, then succeed. */ +function clientFailing(...errors: object[]) { + const queries: string[] = []; + const client = ((strings: TemplateStringsArray) => { + queries.push(strings.join("?")); + const error = errors.shift(); + return error === undefined ? Promise.resolve([]) : Promise.reject(error); + }) as unknown as postgres.Sql; + return { client, queries }; +} + +const concurrent = { code: "XX000", message: "tuple concurrently updated" }; + +describe("grantConsumerRoles", () => { + it("calls the grant function once", async () => { + const { client, queries } = clientFailing(); + await grantConsumerRoles(client); + expect(queries).toEqual(["SELECT conditions.grant_consumer_roles()"]); + }); + + it.each([ + ["a concurrent catalog update", concurrent], + ["a serialization failure", { code: "40001", message: "could not serialize access" }], + ])("tries once more after %s", async (_name, error) => { + const { client, queries } = clientFailing(error); + await grantConsumerRoles(client); + expect(queries).toHaveLength(2); + }); + + it("gives up when the second try fails too", async () => { + const { client, queries } = clientFailing(concurrent, concurrent); + await expect(grantConsumerRoles(client)).rejects.toBe(concurrent); + expect(queries).toHaveLength(2); + }); + + it.each([ + ["any other error", { code: "42501", message: "permission denied for table source" }], + ["another internal error", { code: "XX000", message: "cache lookup failed" }], + ])("fails at once on %s", async (_name, error) => { + const { client, queries } = clientFailing(error); + await expect(grantConsumerRoles(client)).rejects.toBe(error); + expect(queries).toHaveLength(1); + }); +}); diff --git a/packages/core/src/__tests__/migration-files.test.ts b/packages/core/src/__tests__/migration-files.test.ts new file mode 100644 index 000000000..98ccd9efb --- /dev/null +++ b/packages/core/src/__tests__/migration-files.test.ts @@ -0,0 +1,313 @@ +import { readFileSync } from "node:fs"; +import { describe, expect, it } from "vitest"; + +// The migrations folder holds one generated baseline and one custom file with +// what drizzle-kit cannot express. Everything else belongs in the schema code, +// where `drizzle-kit generate` sees it. +const folder = new URL("../../drizzle/", import.meta.url); + +interface Journal { + entries: { idx: number; tag: string; when: number }[]; +} + +const journal = JSON.parse(readFileSync(new URL("meta/_journal.json", folder), "utf8")) as Journal; + +interface Scanned { + /** The text with comments removed, whitespace collapsed and each dollar-quoted body as ``. */ + shape: string; + /** The dollar-quoted bodies, in order. */ + bodies: string[]; + /** The semicolons outside strings, identifiers, bodies and comments. */ + semicolons: number; + /** Why the text cannot be scanned safely, if it cannot. */ + error?: string; +} + +const identifierStart = /[A-Za-z_]/; +const identifierPart = /[A-Za-z0-9_$]/; + +/** + * Reads SQL left to right as PostgreSQL does, recognising `'…'` strings with + * `''` escapes, `"…"` identifiers, `$tag$…$tag$` bodies, `--` comments and + * `/* … *\/` comments in order of appearance, so a dollar sign or semicolon + * inside one of them can neither open another nor end a statement. Strings + * become `'…'` in the shape unless `keepStrings` is set; identifiers stay as + * written. Escape strings (`E'…'`) are refused, since backslashes change + * where they end. + */ +function scan(sql: string, keepStrings = false): Scanned { + let shape = ""; + const bodies: string[] = []; + let semicolons = 0; + let i = 0; + const fail = (error: string): Scanned => ({ shape, bodies, semicolons, error }); + while (i < sql.length) { + const c = sql.charAt(i); + if (sql.startsWith("--", i)) { + const end = sql.indexOf("\n", i); + i = end === -1 ? sql.length : end + 1; + shape += " "; + } else if (sql.startsWith("/*", i)) { + // PostgreSQL nests block comments. + let depth = 1; + let j = i + 2; + while (j < sql.length && depth > 0) { + if (sql.startsWith("/*", j)) { + depth += 1; + j += 2; + } else if (sql.startsWith("*/", j)) { + depth -= 1; + j += 2; + } else { + j += 1; + } + } + if (depth > 0) return fail("unterminated block comment"); + i = j; + shape += " "; + } else if (c === "'") { + let j = i + 1; + for (;;) { + const end = sql.indexOf("'", j); + if (end === -1) return fail("unterminated string"); + if (sql.charAt(end + 1) === "'") { + j = end + 2; + continue; + } + j = end + 1; + break; + } + shape += keepStrings ? sql.slice(i, j) : "'…'"; + i = j; + } else if (c === '"') { + let j = i + 1; + for (;;) { + const end = sql.indexOf('"', j); + if (end === -1) return fail("unterminated quoted identifier"); + if (sql.charAt(end + 1) === '"') { + j = end + 2; + continue; + } + j = end + 1; + break; + } + shape += sql.slice(i, j); + i = j; + } else if (c === "$") { + const tag = /^\$(?:[A-Za-z_][A-Za-z0-9_]*)?\$/.exec(sql.slice(i))?.[0]; + if (tag === undefined) { + shape += c; + i += 1; + continue; + } + const end = sql.indexOf(tag, i + tag.length); + if (end === -1) return fail(`unterminated ${tag} body`); + bodies.push(sql.slice(i + tag.length, end)); + shape += ""; + i = end + tag.length; + } else if (identifierStart.test(c)) { + let j = i + 1; + while (j < sql.length && identifierPart.test(sql.charAt(j))) j += 1; + const word = sql.slice(i, j); + if (/^[Ee]$/.test(word) && sql.charAt(j) === "'") return fail("escape string"); + shape += word; + i = j; + } else { + if (c === ";") semicolons += 1; + shape += c; + i += 1; + } + } + return { shape: shape.replace(/\s+/g, " ").trim(), bodies, semicolons }; +} + +const roleGuard = /^DO ( LANGUAGE plpgsql)?;?$/; + +/** + * A DO block may only guard grants by the existence of a role, since the + * grantee may not exist where the migration runs (the plain PostGIS image of + * the tests has none of OpenMapX's roles). + */ +function isRoleGuardedGrant(body: string): boolean { + const inner = scan(body, true); + if (inner.error !== undefined) return false; + const guarded = + /^BEGIN IF (NOT )?EXISTS \(SELECT (1 )?FROM pg_roles WHERE rolname = '[a-z_]+'\) THEN (.*) END IF; END;?$/i.exec( + inner.shape, + ); + if (!guarded?.[3]) return false; + return guarded[3] + .split(";") + .map((s) => s.trim()) + .filter(Boolean) + .every((s) => /^(GRANT|REVOKE|ALTER DEFAULT PRIVILEGES) [^']*$/i.test(s)); +} + +const allowed: { kind: string; pattern: RegExp }[] = [ + { kind: "grant", pattern: /^(GRANT|REVOKE) [^;]*;?$/ }, + { kind: "default privileges", pattern: /^ALTER DEFAULT PRIVILEGES [^;]*;?$/ }, + { kind: "function body check", pattern: /^SET LOCAL check_function_bodies = (on|off);?$/ }, + { + kind: "function", + pattern: /^CREATE (OR REPLACE )?FUNCTION "?conditions"?\.[^;]*[^;]*;?$/, + }, + { + kind: "trigger", + pattern: + /^CREATE TRIGGER \w+ (BEFORE|AFTER) [A-Z ]+ ON "conditions"\."\w+" FOR EACH ROW EXECUTE FUNCTION "conditions"\.\w+\(\);?$/, + }, + { + kind: "partitioned observation table", + pattern: + /^CREATE TABLE "conditions"\."observation" \([^;]*\) PARTITION BY LIST \("retention_days"\);?$/, + }, + { + kind: "observation partition index", + pattern: /^CREATE INDEX "\w+" ON "conditions"\."observation" USING \w+ \("\w+"\);?$/, + }, + { + kind: "observation_latest storage parameters", + pattern: + /^ALTER TABLE "conditions"\."observation_latest" SET \([a-z_]+ = [0-9.]+(, [a-z_]+ = [0-9.]+)*\);?$/, + }, + { + kind: "observation_latest column storage", + pattern: + /^ALTER TABLE "conditions"\."observation_latest" ALTER COLUMN "\w+" SET STORAGE (EXTERNAL|MAIN);?$/, + }, +]; + +// The federation journal's first epoch, the one seed row. +const seedRow = + 'INSERT INTO "conditions"."federation_journal" (epoch, started_at, seen_xid, timeline_id) VALUES (gen_random_uuid(), now(), pg_snapshot_xmax(pg_current_snapshot()), NULL);'; + +/** The statements of a custom migration that are not of an allowed kind, each with why. */ +function refusals(sql: string): string[] { + const refused: string[] = []; + let seeds = 0; + for (const chunk of sql.split("--> statement-breakpoint")) { + const scanned = scan(chunk); + const s = scanned.shape; + if (scanned.error !== undefined) { + refused.push(`${scanned.error}: ${s}`); + continue; + } + if (s.length === 0) continue; + // drizzle runs a chunk as one query, so a chunk is one statement. + if (scanned.semicolons > 1 || (scanned.semicolons === 1 && !s.endsWith(";"))) { + refused.push(`more than one statement: ${s}`); + continue; + } + // A definer function runs with its owner's rights, so it pins its search path. + if (/\bSECURITY DEFINER\b/i.test(s) && !/\bSET search_path\b/i.test(s)) { + refused.push(`security definer function without a pinned search path: ${s}`); + continue; + } + if (s === seedRow) { + seeds += 1; + if (seeds > 1) refused.push(`second seed row: ${s}`); + continue; + } + const ok = roleGuard.test(s) + ? scanned.bodies.length === 1 && isRoleGuardedGrant(scanned.bodies[0] ?? "") + : allowed.some((a) => a.pattern.test(s)); + if (!ok) refused.push(s); + } + return refused; +} + +describe("migration files", () => { + it("are one generated baseline and one custom file", () => { + expect(journal.entries.map((e) => e.tag)).toEqual(["0000_baseline", "0001_database_objects"]); + }); + + it("the custom migration holds only allowed statement kinds", () => { + const raw = readFileSync(new URL("0001_database_objects.sql", folder), "utf8"); + expect(raw.split("--> statement-breakpoint").length).toBeGreaterThan(1); + expect(refusals(raw)).toEqual([]); + }); + + it.each([ + ["an UPDATE", 'UPDATE "conditions"."source" SET restricted = true;'], + ["an unguarded DO block", "DO $$ BEGIN DELETE FROM conditions.source; END $$;"], + [ + "a DO block that does more than grant", + "DO $$ BEGIN IF EXISTS (SELECT FROM pg_roles WHERE rolname = 'openmapx_tiles') THEN DELETE FROM conditions.source; END IF; END $$;", + ], + [ + "an index drizzle-kit can generate", + 'CREATE INDEX "x_idx" ON "conditions"."source" USING btree ("id");', + ], + [ + "a CHECK drizzle-kit can generate", + 'ALTER TABLE "conditions"."geonet_coverage" ADD CONSTRAINT "geonet_coverage_order_check" CHECK ("covered_from" < "covered_until");', + ], + [ + "a lowercase table", + 'create table "conditions"."observation" ("id" bigint) partition by list ("id");', + ], + [ + "a statement hidden between dollar signs in comments", + "CREATE FUNCTION conditions.f() RETURNS integer AS $$ SELECT 1 $$ LANGUAGE sql;\n-- costs $$\nDELETE FROM conditions.source;\n-- $$", + ], + [ + "a seed row with more rows", + 'INSERT INTO "conditions"."federation_journal" (epoch, started_at, seen_xid, timeline_id) VALUES (gen_random_uuid(), now(), pg_snapshot_xmax(pg_current_snapshot()), NULL), (gen_random_uuid(), now(), pg_snapshot_xmax(pg_current_snapshot()), NULL);', + ], + [ + "a seed row with a trailing clause", + 'INSERT INTO "conditions"."federation_journal" (epoch, started_at, seen_xid, timeline_id) VALUES (gen_random_uuid(), now(), pg_snapshot_xmax(pg_current_snapshot()), NULL) ON CONFLICT DO NOTHING;', + ], + ["a second seed row", `${seedRow}\n--> statement-breakpoint\n${seedRow}`], + [ + "two statements in one chunk", + "GRANT USAGE ON SCHEMA conditions TO a; DROP TABLE conditions.source;", + ], + [ + "a statement hidden between dollar signs in mid-line comments", + "GRANT USAGE ON SCHEMA conditions TO a; -- $$\nDELETE FROM conditions.source; -- $$", + ], + [ + "a statement hidden between dollar signs in block comments", + "GRANT USAGE ON SCHEMA conditions TO a /* $$ */; DELETE FROM conditions.source; /* $$ */", + ], + [ + "a statement hidden between dollar signs in quoted identifiers", + 'GRANT USAGE ON SCHEMA conditions TO "a$$"; DELETE FROM conditions.source; -- "$$"', + ], + [ + "a statement hidden in a role-guarded grant's string", + "DO $$ BEGIN IF EXISTS (SELECT FROM pg_roles WHERE rolname = 'a') THEN GRANT USAGE ON SCHEMA conditions TO a; END IF; END $$; DELETE FROM conditions.source; SELECT '$$';", + ], + ["an unterminated body", "CREATE FUNCTION conditions.f() RETURNS integer AS $$ SELECT 1;"], + [ + "an escape string", + "GRANT USAGE ON SCHEMA conditions TO a; SELECT E'\\'; DELETE FROM conditions.source; --';", + ], + [ + "a security definer function without a pinned search path", + "CREATE FUNCTION conditions.f() RETURNS integer LANGUAGE sql SECURITY DEFINER AS $$ SELECT 1 $$;", + ], + ])("refuses %s", (_name, sql) => { + expect(refusals(sql)).not.toEqual([]); + }); + + it.each([ + [ + "a role-guarded grant", + "DO $$ BEGIN IF EXISTS (SELECT FROM pg_roles WHERE rolname = 'openmapx_tiles_owner') THEN GRANT USAGE ON SCHEMA conditions TO openmapx_tiles_owner; END IF; END $$;", + ], + ["a plain grant", "GRANT SELECT ON conditions.source TO openmapx_tiles_owner;"], + ["the seed row", seedRow], + [ + "dollar signs and semicolons inside comments, strings and identifiers", + 'GRANT SELECT ON "conditions"."a$b" TO openmapx_tiles_owner; -- costs $$; more\n/* $x$ ; */', + ], + [ + "a security definer function with a pinned search path", + "CREATE FUNCTION conditions.f() RETURNS integer LANGUAGE sql SECURITY DEFINER SET search_path = pg_catalog, pg_temp AS $$ SELECT 1 $$;", + ], + ])("accepts %s", (_name, sql) => { + expect(refusals(sql)).toEqual([]); + }); +}); diff --git a/packages/core/src/__tests__/schema-version.test.ts b/packages/core/src/__tests__/schema-version.test.ts new file mode 100644 index 000000000..d68b5ac1d --- /dev/null +++ b/packages/core/src/__tests__/schema-version.test.ts @@ -0,0 +1,48 @@ +import { readFileSync } from "node:fs"; +import { fileURLToPath } from "node:url"; +import { describe, expect, it } from "vitest"; +import { + DEFAULT_SCHEMA_WAIT_TIMEOUT_MS, + expectedSchemaVersion, + schemaWaitTimeoutMs, +} from "../db/schema-version.js"; + +const folder = fileURLToPath(new URL("../../drizzle/", import.meta.url)); + +describe("expectedSchemaVersion", () => { + it("is the last journal entry's tag and time", () => { + const journal = JSON.parse(readFileSync(`${folder}/meta/_journal.json`, "utf8")) as { + entries: { tag: string; when: number }[]; + }; + const last = journal.entries.at(-1)!; + expect(expectedSchemaVersion(folder)).toEqual({ tag: last.tag, when: last.when }); + }); + + it("refuses a folder without a journal", () => { + expect(() => expectedSchemaVersion(fileURLToPath(new URL(".", import.meta.url)))).toThrow( + /ENOENT/, + ); + }); +}); + +describe("schemaWaitTimeoutMs", () => { + const variable = "OPENCONDITIONS_SCHEMA_WAIT_TIMEOUT_MS"; + + it("defaults to five minutes when unset or empty", () => { + expect(DEFAULT_SCHEMA_WAIT_TIMEOUT_MS).toBe(300_000); + expect(schemaWaitTimeoutMs({}, variable)).toBe(300_000); + expect(schemaWaitTimeoutMs({ [variable]: "" }, variable)).toBe(300_000); + expect(schemaWaitTimeoutMs({ [variable]: " " }, variable)).toBe(300_000); + }); + + it("takes a whole number of milliseconds", () => { + expect(schemaWaitTimeoutMs({ [variable]: "900000" }, variable)).toBe(900_000); + expect(schemaWaitTimeoutMs({ [variable]: " 1 " }, variable)).toBe(1); + }); + + it.each(["0", "-5", "1.5", "5m", "1e6", "Infinity"])("refuses %j", (raw) => { + expect(() => schemaWaitTimeoutMs({ [variable]: raw }, variable)).toThrow( + `${variable} must be a whole number of milliseconds above 0, got "${raw}"`, + ); + }); +}); diff --git a/packages/core/src/__tests__/secrets-key-check.integration.test.ts b/packages/core/src/__tests__/secrets-key-check.integration.test.ts new file mode 100644 index 000000000..6c1549830 --- /dev/null +++ b/packages/core/src/__tests__/secrets-key-check.integration.test.ts @@ -0,0 +1,116 @@ +import { + createTestDatabase, + TEST_SECRETS_KEY, + type TestDatabase, +} from "@openconditions/test-database"; +import postgres from "postgres"; +import { afterAll, beforeAll, beforeEach, describe, expect, it } from "vitest"; +import { SecretsKey } from "../crypto/secrets.js"; +import { + SecretsKeyMismatchError, + sealSecretsKeyCheck, + verifySecretsKeyCheck, + waitForSecretsKeyCheck, +} from "../crypto/secrets-key-check.js"; + +/** + * The secrets key check: the ingest service seals one fixed row with its key, + * and every other service refuses to start with a key that does not open it. + */ + +const ingestKey = SecretsKey.parse(TEST_SECRETS_KEY); +const otherKey = SecretsKey.parse("9a".repeat(32)); +const mismatch = /OPENCONDITIONS_SECRETS_KEY differs from the key the ingest service sealed/; + +let db: TestDatabase; +let sql: postgres.Sql; +/** A second pool, as a second process holds. */ +let other: postgres.Sql; + +beforeAll(async () => { + db = await createTestDatabase(); + sql = db.sql; + other = postgres(db.url, { max: 2, onnotice: () => {} }); +}, 120_000); + +afterAll(async () => { + await other?.end(); + await db?.close(); +}, 30_000); + +beforeEach(async () => { + await sql`TRUNCATE conditions.secrets_key_check`; +}); + +describe("conditions.secrets_key_check", () => { + it("is absent until the ingest service seals it, then opens with the ingest service's key", async () => { + expect(await verifySecretsKeyCheck(sql, ingestKey)).toBe("absent"); + await sealSecretsKeyCheck(sql, ingestKey); + expect(await verifySecretsKeyCheck(sql, ingestKey)).toBe("match"); + // A restart seals nothing new and still matches. + await sealSecretsKeyCheck(sql, SecretsKey.parse(TEST_SECRETS_KEY)); + const rows = await sql`SELECT octet_length(value_iv) AS iv, octet_length(value_tag) AS tag + FROM conditions.secrets_key_check`; + expect(rows).toEqual([{ iv: 12, tag: 16 }]); + }); + + it("refuses another key, as another service or a restarted ingest service, naming no key", async () => { + await sealSecretsKeyCheck(sql, ingestKey); + let message = ""; + try { + await verifySecretsKeyCheck(sql, otherKey); + } catch (error) { + expect(error).toBeInstanceOf(SecretsKeyMismatchError); + message = (error as Error).message; + } + expect(message).toMatch(mismatch); + expect(message).not.toContain(TEST_SECRETS_KEY); + await expect(sealSecretsKeyCheck(sql, otherKey)).rejects.toThrow(mismatch); + }); + + it("keeps one row when two processes start together, refusing the one with another key", async () => { + const same = await Promise.allSettled([ + sealSecretsKeyCheck(sql, ingestKey), + sealSecretsKeyCheck(other, ingestKey), + ]); + expect(same.map((r) => r.status)).toEqual(["fulfilled", "fulfilled"]); + expect(await sql`SELECT id FROM conditions.secrets_key_check`).toHaveLength(1); + + await sql`TRUNCATE conditions.secrets_key_check`; + const differing = await Promise.allSettled([ + sealSecretsKeyCheck(sql, ingestKey), + sealSecretsKeyCheck(other, otherKey), + ]); + expect(differing.filter((r) => r.status === "fulfilled")).toHaveLength(1); + const refused = differing.filter((r) => r.status === "rejected"); + expect(refused).toHaveLength(1); + expect(String((refused[0] as PromiseRejectedResult).reason)).toMatch(mismatch); + expect(await sql`SELECT id FROM conditions.secrets_key_check`).toHaveLength(1); + }); + + it("is waited for by a service that starts before the ingest service sealed it", async () => { + const waiting = waitForSecretsKeyCheck(other, ingestKey, { timeoutMs: 10_000, pollMs: 50 }); + await new Promise((resolve) => setTimeout(resolve, 200)); + await sealSecretsKeyCheck(sql, ingestKey); + await expect(waiting).resolves.toBeUndefined(); + await expect( + waitForSecretsKeyCheck(other, otherKey, { timeoutMs: 10_000, pollMs: 50 }), + ).rejects.toThrow(mismatch); + }); + + it("stops waiting after the timeout, saying the ingest service has not sealed it", async () => { + await expect( + waitForSecretsKeyCheck(sql, ingestKey, { timeoutMs: 150, pollMs: 50 }), + ).rejects.toThrow( + /the ingest service did not seal conditions\.secrets_key_check within 150 ms/, + ); + }); + + it("holds one row only", async () => { + await sealSecretsKeyCheck(sql, ingestKey); + await expect( + sql`INSERT INTO conditions.secrets_key_check (id, value_ciphertext, value_iv, value_tag) + SELECT 2, value_ciphertext, value_iv, value_tag FROM conditions.secrets_key_check`, + ).rejects.toThrow(/secrets_key_check_id_check/); + }); +}); diff --git a/packages/core/src/__tests__/secrets.test.ts b/packages/core/src/__tests__/secrets.test.ts new file mode 100644 index 000000000..f53845ef8 --- /dev/null +++ b/packages/core/src/__tests__/secrets.test.ts @@ -0,0 +1,181 @@ +import { randomBytes } from "node:crypto"; +import { mkdtempSync, writeFileSync } from "node:fs"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; +import { inspect } from "node:util"; +import { describe, expect, it } from "vitest"; +import { + type SealedSecret, + type SecretPlace, + SecretsKey, + SecretsKeyError, + secretsKeyFromEnv, + WrongSecretsKeyError, +} from "../crypto/secrets.js"; + +const HEX = "00112233445566778899aabbccddeeff00112233445566778899aabbccddeeff"; +const OTHER_HEX = "ffeeddccbbaa99887766554433221100ffeeddccbbaa99887766554433221100"; +const PLACE: SecretPlace = { table: "oauth_grant", column: "refresh_token", row: "eumetsat" }; + +const flipped = (bytes: Uint8Array, index = 0): Buffer => { + const copy = Buffer.from(bytes); + copy[index] = (copy[index] ?? 0) ^ 0x01; + return copy; +}; + +describe("SecretsKey", () => { + it("opens what it sealed, at the place it sealed it", () => { + const key = SecretsKey.parse(HEX); + const sealed = key.seal("refresh-token-value", PLACE); + expect(sealed.iv).toHaveLength(12); + expect(sealed.tag).toHaveLength(16); + expect(key.openText(sealed, PLACE)).toBe("refresh-token-value"); + const bytes = randomBytes(48); + expect(key.open(key.seal(bytes, PLACE), PLACE).equals(bytes)).toBe(true); + }); + + it("uses a fresh IV for every seal", () => { + const key = SecretsKey.parse(HEX); + const a = key.seal("same", PLACE); + const b = key.seal("same", PLACE); + expect(Buffer.from(a.iv).equals(Buffer.from(b.iv))).toBe(false); + expect(Buffer.from(a.ciphertext).equals(Buffer.from(b.ciphertext))).toBe(false); + }); + + it("never holds the plaintext in what it stores", () => { + const sealed = SecretsKey.parse(HEX).seal("refresh-token-value", PLACE); + const stored = Buffer.concat([sealed.ciphertext, sealed.iv, sealed.tag]); + expect(stored.includes(Buffer.from("refresh-token-value"))).toBe(false); + }); + + describe("refuses a tampered value as a wrong key, naming where it is stored", () => { + const key = SecretsKey.parse(HEX); + const sealed = key.seal("refresh-token-value", PLACE); + const wrong = /wrong key: .*conditions\.oauth_grant\.refresh_token of the row eumetsat/; + const cases: [string, SealedSecret, SecretPlace][] = [ + ["ciphertext", { ...sealed, ciphertext: flipped(sealed.ciphertext) }, PLACE], + ["IV", { ...sealed, iv: flipped(sealed.iv) }, PLACE], + ["tag", { ...sealed, tag: flipped(sealed.tag, 15) }, PLACE], + ["row (additional data)", sealed, { ...PLACE, row: "acme" }], + ["column (additional data)", sealed, { ...PLACE, column: "access_token" }], + ["table (additional data)", sealed, { ...PLACE, table: "issuer_key" }], + ]; + for (const [what, value, place] of cases) { + it(what, () => { + let thrown: unknown; + try { + key.open(value, place); + } catch (error) { + thrown = error; + } + expect(thrown).toBeInstanceOf(WrongSecretsKeyError); + expect((thrown as Error).message).toMatch(place === PLACE ? wrong : /^wrong key: /); + }); + } + }); + + it("refuses a value sealed under another key, without revealing either", () => { + const sealed = SecretsKey.parse(HEX).seal("refresh-token-value", PLACE); + let message = ""; + try { + SecretsKey.parse(OTHER_HEX).open(sealed, PLACE); + } catch (error) { + message = (error as Error).message; + } + expect(message).toMatch(/^wrong key: /); + expect(message).not.toContain(HEX); + expect(message).not.toContain(OTHER_HEX); + expect(message).not.toContain("refresh-token-value"); + }); + + it("checks the stored IV and tag lengths", () => { + const key = SecretsKey.parse(HEX); + const sealed = key.seal("value", PLACE); + expect(() => key.open({ ...sealed, iv: sealed.iv.subarray(0, 11) }, PLACE)).toThrow( + /conditions\.oauth_grant\.refresh_token of the row eumetsat is malformed: its IV is 11 bytes, not 12/, + ); + expect(() => + key.open({ ...sealed, tag: Buffer.concat([sealed.tag, sealed.tag]) }, PLACE), + ).toThrow(/malformed: its tag is 32 bytes, not 16/); + }); + + describe("refuses a malformed key without echoing it", () => { + const cases: [string, string][] = [ + ["empty", ""], + ["too short", HEX.slice(0, 62)], + ["too long", `${HEX}00`], + ["not hex", `${HEX.slice(0, 63)}g`], + ["base64url of 32 bytes", Buffer.from(HEX, "hex").toString("base64url")], + ]; + for (const [what, text] of cases) { + it(what, () => { + let message = ""; + try { + SecretsKey.parse(text); + } catch (error) { + message = (error as Error).message; + expect(error).toBeInstanceOf(SecretsKeyError); + } + expect(message).toMatch(/OPENCONDITIONS_SECRETS_KEY must be 64 hexadecimal characters/); + expect(message).toContain("openssl rand -hex 32"); + if (text !== "") expect(message).not.toContain(text); + }); + } + }); + + it("accepts upper-case hex and surrounding whitespace", () => { + const sealed = SecretsKey.parse(HEX).seal("value", PLACE); + expect(SecretsKey.parse(` ${HEX.toUpperCase()}\n`).openText(sealed, PLACE)).toBe("value"); + }); + + it("shows nothing of the key when printed or serialized", () => { + const key = SecretsKey.parse(HEX); + expect(JSON.stringify(key)).not.toContain("0011"); + expect(String(key)).not.toContain("0011"); + expect(inspect(key, { showHidden: true, depth: 5 })).not.toContain("0011"); + }); +}); + +describe("secretsKeyFromEnv", () => { + const fileHolding = (contents: string): string => { + const file = join(mkdtempSync(join(tmpdir(), "oc-secrets-key-")), "key"); + writeFileSync(file, contents); + return file; + }; + + it("reads the key from OPENCONDITIONS_SECRETS_KEY_FILE, trimmed", () => { + const sealed = SecretsKey.parse(HEX).seal("value", PLACE); + const key = secretsKeyFromEnv({ OPENCONDITIONS_SECRETS_KEY_FILE: fileHolding(`${HEX}\n`) }); + expect(key.openText(sealed, PLACE)).toBe("value"); + }); + + it("reads the key from OPENCONDITIONS_SECRETS_KEY", () => { + const sealed = SecretsKey.parse(HEX).seal("value", PLACE); + expect(secretsKeyFromEnv({ OPENCONDITIONS_SECRETS_KEY: HEX }).openText(sealed, PLACE)).toBe( + "value", + ); + }); + + it("refuses a missing key, naming the file variable and how to make one", () => { + expect(() => secretsKeyFromEnv({})).toThrow( + /OPENCONDITIONS_SECRETS_KEY is required: set OPENCONDITIONS_SECRETS_KEY_FILE to a file holding it .*openssl rand -hex 32/, + ); + }); + + it("refuses a key file that is missing or empty, naming the path", () => { + const missing = join(tmpdir(), "oc-secrets-key-missing", "key"); + expect(() => secretsKeyFromEnv({ OPENCONDITIONS_SECRETS_KEY_FILE: missing })).toThrow( + `OPENCONDITIONS_SECRETS_KEY_FILE (${missing}) could not be read: ENOENT`, + ); + const empty = fileHolding("\n"); + expect(() => secretsKeyFromEnv({ OPENCONDITIONS_SECRETS_KEY_FILE: empty })).toThrow( + `OPENCONDITIONS_SECRETS_KEY_FILE (${empty}) is empty`, + ); + }); + + it("refuses a malformed key file", () => { + expect(() => + secretsKeyFromEnv({ OPENCONDITIONS_SECRETS_KEY_FILE: fileHolding("not-a-key") }), + ).toThrow(/must be 64 hexadecimal characters/); + }); +}); diff --git a/packages/core/src/credentials.ts b/packages/core/src/credentials.ts new file mode 100644 index 000000000..396809556 --- /dev/null +++ b/packages/core/src/credentials.ts @@ -0,0 +1,40 @@ +import { readFileSync } from "node:fs"; + +/** Where a service reads its credentials: `process.env` or a test's stand-in. */ +export type CredentialEnv = Record; + +/** What reading a credential found: its value, nothing set, or why its file yielded nothing. */ +export type CredentialRead = { value: string } | { unset: true } | { failure: string }; + +/** + * A credential as the services read every secret: the variable ``, + * else the file `_FILE` names (how OpenMapX mounts a vault secret), + * both trimmed. An empty variable falls through to the file, so a blank + * placeholder never shadows a mounted secret. + */ +export function readCredential(env: CredentialEnv, name: string): CredentialRead { + const direct = env[name]?.trim(); + if (direct) return { value: direct }; + const filePath = env[`${name}_FILE`]?.trim(); + if (!filePath) return { unset: true }; + let contents: string; + try { + contents = readFileSync(filePath, "utf8").trim(); + } catch (error) { + const code = (error as NodeJS.ErrnoException).code ?? String(error); + return { failure: `${name}_FILE (${filePath}) could not be read: ${code}` }; + } + return contents ? { value: contents } : { failure: `${name}_FILE (${filePath}) is empty` }; +} + +/** + * A service secret read like a credential, but strictly: undefined only when + * neither `` nor `_FILE` is set. A `_FILE` that is set but + * unreadable or empty throws naming the path and the cause, so a secret the + * operator did configure never silently counts as absent. + */ +export function strictCredential(env: CredentialEnv, name: string): string | undefined { + const read = readCredential(env, name); + if ("failure" in read) throw new Error(read.failure); + return "value" in read ? read.value : undefined; +} diff --git a/packages/core/src/crypto/secrets-key-check.ts b/packages/core/src/crypto/secrets-key-check.ts new file mode 100644 index 000000000..f520d3f60 --- /dev/null +++ b/packages/core/src/crypto/secrets-key-check.ts @@ -0,0 +1,110 @@ +import { setTimeout as sleep } from "node:timers/promises"; +import type postgres from "postgres"; +import { + SECRETS_KEY_VARIABLE, + type SecretPlace, + type SecretsKey, + WrongSecretsKeyError, +} from "./secrets.js"; +import { storedSecret } from "./stored-secrets.js"; + +/** Where the check value is stored, which its sealing binds. */ +const PLACE: SecretPlace = { table: "secrets_key_check", column: "value", row: "1" }; + +/** The fixed text the check row seals. */ +const CHECK_TEXT = "openconditions secrets key check"; + +const DEFAULT_POLL_MS = 2_000; + +/** This service's secrets key is not the one the ingest service sealed the check row with. */ +export class SecretsKeyMismatchError extends Error { + override name = "SecretsKeyMismatchError"; +} + +const mismatch = () => + new SecretsKeyMismatchError( + `${SECRETS_KEY_VARIABLE} differs from the key the ingest service sealed in conditions.secrets_key_check: give this service the ingest service's key, never a newly generated one`, + ); + +/** + * Opens the check row with `key`: "match" when it opens to the check text, + * "absent" before the ingest service wrote it. Throws a + * {@link SecretsKeyMismatchError} when it does not open, naming no key. + */ +export async function verifySecretsKeyCheck( + sql: postgres.Sql, + key: SecretsKey, +): Promise<"match" | "absent"> { + const [row] = await sql` + SELECT value_ciphertext, value_iv, value_tag FROM conditions.secrets_key_check WHERE id = 1`; + if (row === undefined) return "absent"; + const sealed = storedSecret(row, PLACE); + if (sealed === null) throw mismatch(); + let text: string; + try { + text = key.openText(sealed, PLACE); + } catch (error) { + if (error instanceof WrongSecretsKeyError) throw mismatch(); + throw error; + } + if (text !== CHECK_TEXT) throw mismatch(); + return "match"; +} + +/** + * The ingest service's step at start, after the migrations: seals the check + * row with `key` unless a row is there already, then verifies the stored row. + * Two processes starting together write one row; the one whose key differs + * from the stored row's fails with a {@link SecretsKeyMismatchError}. + */ +export async function sealSecretsKeyCheck(sql: postgres.Sql, key: SecretsKey): Promise { + const sealed = key.seal(CHECK_TEXT, PLACE); + await sql` + INSERT INTO conditions.secrets_key_check (id, value_ciphertext, value_iv, value_tag) + VALUES (1, ${Buffer.from(sealed.ciphertext)}, ${Buffer.from(sealed.iv)}, + ${Buffer.from(sealed.tag)}) + ON CONFLICT (id) DO NOTHING`; + if ((await verifySecretsKeyCheck(sql, key)) !== "match") { + throw new Error("conditions.secrets_key_check is empty after it was written"); + } +} + +export interface WaitForSecretsKeyCheckOptions { + /** How long to wait for the ingest service to write the row. */ + timeoutMs: number; + pollMs?: number; + /** Called once when the row is not there yet. */ + onWait?: () => void; +} + +/** + * The start of a service that does not migrate, after + * `waitForSchemaVersion`: waits until the ingest service has sealed the + * check row, then verifies `key` against it. Throws a + * {@link SecretsKeyMismatchError} on another key, and a clear error when the + * row does not appear within `timeoutMs`. + */ +export async function waitForSecretsKeyCheck( + sql: postgres.Sql, + key: SecretsKey, + options: WaitForSecretsKeyCheckOptions, +): Promise { + const pollMs = options.pollMs ?? DEFAULT_POLL_MS; + const deadline = Date.now() + options.timeoutMs; + let told = false; + for (;;) { + if ((await verifySecretsKeyCheck(sql, key)) === "match") return; + const left = deadline - Date.now(); + if (left <= 0) { + throw new Error( + `the ingest service did not seal conditions.secrets_key_check within ${options.timeoutMs} ms: ` + + `start the ingest service with ${SECRETS_KEY_VARIABLE} first`, + ); + } + if (!told) { + options.onWait?.(); + told = true; + } + await sleep(Math.min(pollMs, left)); + } +} diff --git a/packages/core/src/crypto/secrets.ts b/packages/core/src/crypto/secrets.ts new file mode 100644 index 000000000..2151a683f --- /dev/null +++ b/packages/core/src/crypto/secrets.ts @@ -0,0 +1,146 @@ +import { createCipheriv, createDecipheriv, randomBytes } from "node:crypto"; +import { type CredentialEnv, readCredential } from "../credentials.js"; + +/** + * The variable that holds the key every OpenConditions service encrypts its + * stored secrets with (OAuth grant tokens and private keys). Under OpenMapX it + * is a vault secret, mounted as a file named by `OPENCONDITIONS_SECRETS_KEY_FILE`. + */ +export const SECRETS_KEY_VARIABLE = "OPENCONDITIONS_SECRETS_KEY"; + +/** The AES-256-GCM IV length, in bytes. */ +export const SECRET_IV_BYTES = 12; + +/** The AES-256-GCM authentication tag length, in bytes. */ +export const SECRET_TAG_BYTES = 16; + +const KEY_FORMAT = `${SECRETS_KEY_VARIABLE} must be 64 hexadecimal characters (a 32-byte key; generate one with \`openssl rand -hex 32\`)`; + +/** A secret as it is stored: its AES-256-GCM ciphertext, IV and authentication tag. */ +export interface SealedSecret { + ciphertext: Uint8Array; + iv: Uint8Array; + tag: Uint8Array; +} + +/** + * Where a secret is stored: the table, the secret's column (without the + * `_ciphertext` suffix) and the row's primary key. It is bound to the + * ciphertext as additional authenticated data, so a value copied to another + * row or column does not open. + */ +export interface SecretPlace { + table: string; + column: string; + row: string; +} + +/** The secrets key is missing or not a key. */ +export class SecretsKeyError extends Error { + override name = "SecretsKeyError"; +} + +/** + * A stored secret does not open under the configured key: the key is not + * the one that sealed it, or the stored value was altered. + */ +export class WrongSecretsKeyError extends Error { + override name = "WrongSecretsKeyError"; +} + +const where = (place: SecretPlace) => + `conditions.${place.table}.${place.column} of the row ${place.row}`; + +const additionalData = (place: SecretPlace) => + Buffer.from(JSON.stringify(["conditions", place.table, place.column, place.row]), "utf8"); + +/** + * The key OpenConditions encrypts its stored secrets with (AES-256-GCM). The + * key bytes live in a private field and are never printed or serialized. + */ +export class SecretsKey { + readonly #key: Buffer; + + private constructor(key: Buffer) { + this.#key = key; + } + + /** The key written as 64 hexadecimal characters; surrounding whitespace is ignored. */ + static parse(text: string): SecretsKey { + const hex = text.trim(); + if (!/^[0-9a-fA-F]{64}$/.test(hex)) throw new SecretsKeyError(KEY_FORMAT); + return new SecretsKey(Buffer.from(hex, "hex")); + } + + /** Encrypts `plaintext` for storage at `place`, under a fresh random IV. */ + seal(plaintext: Uint8Array | string, place: SecretPlace): SealedSecret { + const iv = randomBytes(SECRET_IV_BYTES); + const cipher = createCipheriv("aes-256-gcm", this.#key, iv, { + authTagLength: SECRET_TAG_BYTES, + }); + cipher.setAAD(additionalData(place)); + const bytes = typeof plaintext === "string" ? Buffer.from(plaintext, "utf8") : plaintext; + const ciphertext = Buffer.concat([cipher.update(bytes), cipher.final()]); + return { ciphertext, iv, tag: cipher.getAuthTag() }; + } + + /** + * Decrypts a secret stored at `place`. Throws a {@link WrongSecretsKeyError} + * naming the place, never a value, when it does not open. + */ + open(sealed: SealedSecret, place: SecretPlace): Buffer { + if (sealed.iv.length !== SECRET_IV_BYTES) { + throw new Error( + `${where(place)} is malformed: its IV is ${sealed.iv.length} bytes, not ${SECRET_IV_BYTES}`, + ); + } + if (sealed.tag.length !== SECRET_TAG_BYTES) { + throw new Error( + `${where(place)} is malformed: its tag is ${sealed.tag.length} bytes, not ${SECRET_TAG_BYTES}`, + ); + } + const decipher = createDecipheriv("aes-256-gcm", this.#key, sealed.iv, { + authTagLength: SECRET_TAG_BYTES, + }); + decipher.setAAD(additionalData(place)); + decipher.setAuthTag(sealed.tag); + try { + return Buffer.concat([decipher.update(sealed.ciphertext), decipher.final()]); + } catch { + throw new WrongSecretsKeyError( + `wrong key: ${SECRETS_KEY_VARIABLE} cannot decrypt ${where(place)}; it is not the key that encrypted it, or the stored value was altered`, + ); + } + } + + /** {@link open}, as UTF-8 text. */ + openText(sealed: SealedSecret, place: SecretPlace): string { + return this.open(sealed, place).toString("utf8"); + } + + toJSON(): string { + return "[SecretsKey]"; + } + + toString(): string { + return "[SecretsKey]"; + } +} + +/** + * The secrets key from `OPENCONDITIONS_SECRETS_KEY`, else from the file + * `OPENCONDITIONS_SECRETS_KEY_FILE` names (how OpenMapX mounts a vault + * secret), trimmed. Throws a {@link SecretsKeyError} when neither is set, the + * file yields nothing, or the value is not a key, so a service that stores + * secrets refuses to start without one. + */ +export function secretsKeyFromEnv(env: CredentialEnv): SecretsKey { + const read = readCredential(env, SECRETS_KEY_VARIABLE); + if ("failure" in read) throw new SecretsKeyError(read.failure); + if ("unset" in read) { + throw new SecretsKeyError( + `${SECRETS_KEY_VARIABLE} is required: set ${SECRETS_KEY_VARIABLE}_FILE to a file holding it (64 hexadecimal characters). Every OpenConditions service of an instance uses the key the ingest service holds; only the ingest service's is generated, with \`openssl rand -hex 32\`.`, + ); + } + return SecretsKey.parse(read.value); +} diff --git a/packages/core/src/crypto/stored-secrets.ts b/packages/core/src/crypto/stored-secrets.ts new file mode 100644 index 000000000..70c0d2027 --- /dev/null +++ b/packages/core/src/crypto/stored-secrets.ts @@ -0,0 +1,72 @@ +import type postgres from "postgres"; +import type { SealedSecret, SecretPlace, SecretsKey } from "./secrets.js"; + +/** + * The secret `column` of a row as stored in its `_ciphertext`, + * `_iv` and `_tag` columns; null when all three are null. + */ +export function storedSecret(row: postgres.Row, place: SecretPlace): SealedSecret | null { + const ciphertext = row[`${place.column}_ciphertext`] as Buffer | null | undefined; + const iv = row[`${place.column}_iv`] as Buffer | null | undefined; + const tag = row[`${place.column}_tag`] as Buffer | null | undefined; + if (ciphertext == null && iv == null && tag == null) return null; + if (ciphertext == null || iv == null || tag == null) { + throw new Error( + `conditions.${place.table}.${place.column} of the row ${place.row} is malformed: its ciphertext, IV and tag are not all stored`, + ); + } + return { ciphertext, iv, tag }; +} + +/** A table that stores secrets: its name, its primary key column and its secrets' columns. */ +export interface SecretTable { + table: string; + rowKey: string; + columns: readonly string[]; +} + +/** + * The contributions service's issuer keys' table and the secret it stores + * sealed. It is defined here because the ingest service, which owns the + * table, also opens these keys at start. + */ +export const ISSUER_KEY_SECRETS: SecretTable = { + table: "issuer_key", + rowKey: "key_id", + columns: ["private_key"], +}; + +/** + * The federation service's instance keys' table and the secret it stores + * sealed. It is defined here because the ingest service, which owns the + * table, also opens these keys at start. + */ +export const INSTANCE_KEY_SECRETS: SecretTable = { + table: "federation_instance_key", + rowKey: "key_id", + columns: ["private_key"], +}; + +/** + * Opens every secret stored in `spec.table` under `key` and discards the + * plaintext. A service calls it at start, so a key that is not the one the + * secrets were sealed with stops the boot with a "wrong key" error naming the + * table, column and row, instead of failing at the first use. + */ +export async function assertStoredSecretsOpen( + sql: postgres.Sql, + key: SecretsKey, + spec: SecretTable, +): Promise { + const columns = spec.columns.flatMap((c) => [`${c}_ciphertext`, `${c}_iv`, `${c}_tag`]); + const rows = await sql.unsafe( + `SELECT ${[spec.rowKey, ...columns].map((c) => `"${c}"`).join(", ")} FROM "conditions"."${spec.table}"`, + ); + for (const row of rows) { + for (const column of spec.columns) { + const place = { table: spec.table, column, row: String(row[spec.rowKey]) }; + const sealed = storedSecret(row, place); + if (sealed !== null) key.open(sealed, place).fill(0); + } + } +} diff --git a/packages/core/src/db/binding-schema.ts b/packages/core/src/db/binding-schema.ts index a81a82584..b06cbc457 100644 --- a/packages/core/src/db/binding-schema.ts +++ b/packages/core/src/db/binding-schema.ts @@ -11,6 +11,7 @@ import { text, timestamp, } from "drizzle-orm/pg-core"; +import { BINDING_STATUSES, DIRECTION_MODES } from "../types.js"; import { conditionsSchema } from "./columns.js"; /** @@ -41,12 +42,17 @@ export const recordBinding = conditionsSchema.table( boundAt: timestamp("bound_at", { withTimezone: true }).notNull(), }, (t) => [ - primaryKey({ columns: [t.recordClass, t.recordId, t.effectId] }), + primaryKey({ name: "record_binding_pkey", columns: [t.recordClass, t.recordId, t.effectId] }), check( - "record_binding_record_class_enum", + "record_binding_record_class_check", sql.raw(enumCheckSql("record_class", RECORD_CLASSES)), ), - index("idx_record_binding_status").on(t.status), + check("record_binding_status_check", sql.raw(enumCheckSql("status", BINDING_STATUSES))), + check( + "record_binding_direction_mode_check", + sql.raw(enumCheckSql("direction_mode", DIRECTION_MODES)), + ), + index("record_binding_status_idx").on(t.status), ], ); @@ -69,8 +75,8 @@ export const bindingQueue = conditionsSchema.table( updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(), }, (t) => [ - primaryKey({ columns: [t.recordClass, t.recordId, t.effectId] }), - index("idx_binding_queue_due").on(t.nextAttemptAt), + primaryKey({ name: "binding_queue_pkey", columns: [t.recordClass, t.recordId, t.effectId] }), + index("binding_queue_next_attempt_at_idx").on(t.nextAttemptAt), ], ); @@ -94,7 +100,10 @@ export const recordSegment = conditionsSchema.table( endFraction: doublePrecision("end_fraction").notNull(), }, (t) => [ - primaryKey({ columns: [t.recordClass, t.recordId, t.effectId, t.seq] }), - index("idx_record_segment_segment").on(t.segmentId), + primaryKey({ + name: "record_segment_pkey", + columns: [t.recordClass, t.recordId, t.effectId, t.seq], + }), + index("record_segment_segment_id_idx").on(t.segmentId), ], ); diff --git a/packages/core/src/db/columns.ts b/packages/core/src/db/columns.ts index 7c8fe5396..361be074a 100644 --- a/packages/core/src/db/columns.ts +++ b/packages/core/src/db/columns.ts @@ -1,3 +1,4 @@ +import { type SQL, sql } from "drizzle-orm"; import { customType, pgSchema, timestamp } from "drizzle-orm/pg-core"; /** The service's Postgres schema; every OpenConditions table lives in it. */ @@ -21,13 +22,25 @@ export const geometryPoint = customType<{ data: string }>({ }, }); -/** Raw bytes column (issuer signing keypair material). */ +/** Raw bytes column (public keys, signatures, sealed secrets). */ export const bytea = customType<{ data: Buffer; default: false }>({ dataType() { return "bytea"; }, }); +/** + * The CHECK of a secret stored AES-256-GCM sealed in `_ciphertext`, + * `_iv` and `_tag`: the three are stored together (or, in + * nullable columns, all left null), with a 12-byte IV and a 16-byte tag. + */ +export function sealedSecretCheck(column: string): SQL { + const [c, iv, tag] = ["ciphertext", "iv", "tag"].map((part) => `"${column}_${part}"`); + return sql.raw( + `(${c} IS NULL) = (${iv} IS NULL) AND (${iv} IS NULL) = (${tag} IS NULL) AND octet_length(${iv}) = 12 AND octet_length(${tag}) = 16`, + ); +} + /** 64-bit transaction id (`xid8`) — the epoch-safe full transaction id used to * fence the federation outbox cursor against not-yet-committed lower seqs. */ export const xid8 = customType<{ data: string }>({ diff --git a/packages/core/src/db/crowd-schema.ts b/packages/core/src/db/crowd-schema.ts index f951bcb16..cb36ba853 100644 --- a/packages/core/src/db/crowd-schema.ts +++ b/packages/core/src/db/crowd-schema.ts @@ -1,7 +1,17 @@ import { enumCheckSql, RECORD_CLASSES, SUB_CLAIM_TYPES } from "@openconditions/model"; import { sql } from "drizzle-orm"; -import { bigserial, check, index, jsonb, text, timestamp, uniqueIndex } from "drizzle-orm/pg-core"; +import { + bigint, + check, + foreignKey, + index, + jsonb, + text, + timestamp, + unique, +} from "drizzle-orm/pg-core"; import { conditionsSchema, geometryPoint } from "./columns.js"; +import { reporter } from "./schema.js"; /** What the evidence ledger records: a report, a vote, or an external resolution. */ export const EVIDENCE_KINDS = [ @@ -16,9 +26,9 @@ export const EVIDENCE_KINDS = [ /** * A signed reaction to a record: a confirm, negate, or flag from one reporter * key. The id is the hash of the key and the claim's nonce, so a replayed vote - * collides on it and the key never shows. The unique index enforces one - * reaction per (record, component, key, type) so a key cannot stuff the - * ballot on a single subject. + * collides on it and the key never shows. The unique constraint enforces one + * reaction per (record, key, type) so a key cannot stuff the ballot on a + * single subject. Deleting the reporter deletes its votes. */ export const subClaim = conditionsSchema.table( "sub_claim", @@ -26,7 +36,6 @@ export const subClaim = conditionsSchema.table( id: text("id").primaryKey(), subjectClass: text("subject_class").notNull(), subjectId: text("subject_id").notNull(), - subjectComponentKey: text("subject_component_key").notNull().default(""), claimType: text("claim_type").notNull(), keyId: text("key_id").notNull(), reason: text("reason"), @@ -35,16 +44,20 @@ export const subClaim = conditionsSchema.table( createdAt: timestamp("created_at", { withTimezone: true }).notNull(), }, (t) => [ - uniqueIndex("uq_sub_claim_subject_key_type").on( + unique("sub_claim_subject_class_subject_id_key_id_claim_type_key").on( t.subjectClass, t.subjectId, - t.subjectComponentKey, t.keyId, t.claimType, ), - index("idx_sub_claim_key").on(t.keyId), - check("sub_claim_claim_type_enum", sql.raw(enumCheckSql("claim_type", SUB_CLAIM_TYPES))), - check("sub_claim_subject_class_enum", sql.raw(enumCheckSql("subject_class", RECORD_CLASSES))), + foreignKey({ + name: "sub_claim_key_id_fkey", + columns: [t.keyId], + foreignColumns: [reporter.keyId], + }).onDelete("cascade"), + index("sub_claim_key_id_idx").on(t.keyId), + check("sub_claim_claim_type_check", sql.raw(enumCheckSql("claim_type", SUB_CLAIM_TYPES))), + check("sub_claim_subject_class_check", sql.raw(enumCheckSql("subject_class", RECORD_CLASSES))), ], ); @@ -53,19 +66,24 @@ export const subClaim = conditionsSchema.table( * named and when it arrived. The report-rate limiter counts refusals beside * landed reports, so refused reports cannot outpace the rate either. No * evidence: a refusal names no record. Rows outlive the rate window only - * until the next refusal prunes them. + * until the next refusal prunes them, or until the reporter is deleted. */ export const reportRefusal = conditionsSchema.table( "report_refusal", { - id: bigserial("id", { mode: "number" }).primaryKey(), + id: bigint("id", { mode: "number" }).primaryKey().generatedByDefaultAsIdentity(), actorKeyId: text("actor_key_id").notNull(), cell: text("cell").notNull(), occurredAt: timestamp("occurred_at", { withTimezone: true }).notNull(), }, (t) => [ - index("idx_report_refusal_actor").on(t.actorKeyId, t.occurredAt), - index("idx_report_refusal_occurred").on(t.occurredAt), + foreignKey({ + name: "report_refusal_actor_key_id_fkey", + columns: [t.actorKeyId], + foreignColumns: [reporter.keyId], + }).onDelete("cascade"), + index("report_refusal_actor_key_id_occurred_at_idx").on(t.actorKeyId, t.occurredAt), + index("report_refusal_occurred_at_idx").on(t.occurredAt), ], ); @@ -75,12 +93,14 @@ export const reportRefusal = conditionsSchema.table( * resolution). The record's evidence summary is a replayable projection of * these rows (`evidenceRowsToLedger` + `evaluateEvidence`). A confirm merged * from another report names it in `details.merged`, which is how a merged - * report finds its survivor. + * report finds its survivor. `actor_key_id` is a local reporter or null (a + * peer's delivery, an external resolution); deleting the reporter keeps its + * evidence and clears the key. */ export const reportEvidence = conditionsSchema.table( "report_evidence", { - id: bigserial("id", { mode: "number" }).primaryKey(), + id: bigint("id", { mode: "number" }).primaryKey().generatedByDefaultAsIdentity(), recordClass: text("record_class").notNull(), recordId: text("record_id").notNull(), componentKey: text("component_key").notNull().default(""), @@ -91,15 +111,27 @@ export const reportEvidence = conditionsSchema.table( details: jsonb("details").notNull().default(sql`'{}'::jsonb`), }, (t) => [ - index("idx_report_evidence_record").on(t.recordClass, t.recordId, t.occurredAt), + foreignKey({ + name: "report_evidence_actor_key_id_fkey", + columns: [t.actorKeyId], + foreignColumns: [reporter.keyId], + }).onDelete("set null"), + index("report_evidence_record_class_record_id_occurred_at_idx").on( + t.recordClass, + t.recordId, + t.occurredAt, + ), // Supports the per-key report-rate limiter's trailing-window count. - index("idx_report_evidence_actor").on(t.actorKeyId, t.occurredAt), - index("idx_report_evidence_merged") + index("report_evidence_actor_key_id_occurred_at_idx").on(t.actorKeyId, t.occurredAt), + index("report_evidence_merged_idx") .on(sql`(${t.details} ->> 'merged')`) .where(sql`${t.details} ? 'merged'`), - check("report_evidence_kind_enum", sql.raw(enumCheckSql("evidence_kind", EVIDENCE_KINDS))), check( - "report_evidence_record_class_enum", + "report_evidence_evidence_kind_check", + sql.raw(enumCheckSql("evidence_kind", EVIDENCE_KINDS)), + ), + check( + "report_evidence_record_class_check", sql.raw(enumCheckSql("record_class", RECORD_CLASSES)), ), ], diff --git a/packages/core/src/db/index.ts b/packages/core/src/db/index.ts index d472c5a96..4ecb7d050 100644 --- a/packages/core/src/db/index.ts +++ b/packages/core/src/db/index.ts @@ -43,4 +43,14 @@ export { sensorSegment, sourceStatus, } from "./schema.js"; +export { + type AppliedSchemaVersion, + appliedSchemaVersion, + DEFAULT_SCHEMA_WAIT_TIMEOUT_MS, + expectedSchemaVersion, + type SchemaVersion, + schemaWaitTimeoutMs, + type WaitForSchemaVersionOptions, + waitForSchemaVersion, +} from "./schema-version.js"; export { oauthGrant, source } from "./source-schema.js"; diff --git a/packages/core/src/db/jma-schema.ts b/packages/core/src/db/jma-schema.ts index 71f67ba04..27f33df03 100644 --- a/packages/core/src/db/jma-schema.ts +++ b/packages/core/src/db/jma-schema.ts @@ -1,5 +1,5 @@ import { sql } from "drizzle-orm"; -import { bigint, check, jsonb, primaryKey, text } from "drizzle-orm/pg-core"; +import { bigint, check, date, jsonb, primaryKey, text } from "drizzle-orm/pg-core"; import { conditionsSchema } from "./columns.js"; /** Shared by all JMA sources and workers using one explicitly identified egress IP. */ @@ -7,13 +7,13 @@ export const jmaBudget = conditionsSchema.table( "jma_budget", { egress: text("egress").notNull(), - day: text("day").notNull(), + day: date("day", { mode: "string" }).notNull(), used: bigint("used", { mode: "number" }).notNull().default(0), reserved: bigint("reserved", { mode: "number" }).notNull().default(0), }, (t) => [ - primaryKey({ columns: [t.egress, t.day] }), - check("jma_budget_nonnegative", sql`${t.used} >= 0 AND ${t.reserved} >= 0`), + primaryKey({ name: "jma_budget_pkey", columns: [t.egress, t.day] }), + check("jma_budget_nonnegative_check", sql`${t.used} >= 0 AND ${t.reserved} >= 0`), ], ); diff --git a/packages/core/src/db/migrate.ts b/packages/core/src/db/migrate.ts index 3be3acc61..f7e9aa104 100644 --- a/packages/core/src/db/migrate.ts +++ b/packages/core/src/db/migrate.ts @@ -4,6 +4,10 @@ import { drizzle } from "drizzle-orm/postgres-js"; import { migrate } from "drizzle-orm/postgres-js/migrator"; import postgres from "postgres"; +/** Where the applied migrations are recorded: `conditions.__drizzle_migrations`. */ +export const MIGRATIONS_SCHEMA = "conditions"; +export const MIGRATIONS_TABLE = "__drizzle_migrations"; + /** * Resolves the drizzle-kit migrations folder relative to the running module, * tolerating both layouts this code runs in: @@ -12,7 +16,7 @@ import postgres from "postgres"; * - inlined into a service bundle: the service's build copies `drizzle/` next * to its entry, so `./drizzle` resolves there. */ -function resolveMigrationsFolder(): string { +export function resolveMigrationsFolder(): string { const candidates = ["../drizzle", "./drizzle"].map((rel) => fileURLToPath(new URL(rel, import.meta.url)), ); @@ -24,11 +28,16 @@ function resolveMigrationsFolder(): string { } /** - * Applies all pending versioned migrations (generated by drizzle-kit from - * `schema.ts`, in `packages/core/drizzle/`) to the database. Applied migrations - * are tracked in `drizzle.__drizzle_migrations_oc` — a dedicated table so an - * OpenConditions DB shared with another Drizzle project (e.g. OpenMapX in dev) - * keeps separate histories. Idempotent; safe to run on every service boot. + * Applies all pending migrations in `packages/core/drizzle/` (a baseline + * drizzle-kit generates from the schema code, and a custom file with what it + * cannot express; see docs/database-migrations.md) to the database. Applied + * migrations are tracked in `conditions.__drizzle_migrations`, inside the + * schema they describe: the history stays apart from another Drizzle + * project's in a shared database (OpenMapX keeps its own in `drizzle`), the + * role that owns `conditions` needs no other schema, and dropping `conditions` + * drops its history with it. Idempotent. Only the ingest service's processes + * (the primary and, when enabled, the heavy-feeds process) run it at boot; + * the other services wait for its result with `waitForSchemaVersion`. * * Takes a connection string (not a client) and opens its own short-lived * `max: 1` connection: drizzle's postgres-js driver replaces the client's type @@ -40,6 +49,10 @@ function resolveMigrationsFolder(): string { * migration: drizzle-kit cannot model `CREATE EXTENSION`, and the generated * migrations reference the `conditions` schema and the `geometry` type, both * of which must already exist before the first migration runs. + * + * After the migrations it grants the roles of OpenMapX's traffic tile and the + * contributions service what they use ({@link grantConsumerRoles}), so a role + * created after the first migrate gets its grants at the next start. */ export async function runMigrations(connectionString: string): Promise { const migrationsFolder = resolveMigrationsFolder(); @@ -61,8 +74,21 @@ export async function runMigrations(connectionString: string): Promise { await client`CREATE SCHEMA IF NOT EXISTS conditions`; await migrate(drizzle(client), { migrationsFolder, - migrationsTable: "__drizzle_migrations_oc", + migrationsSchema: MIGRATIONS_SCHEMA, + migrationsTable: MIGRATIONS_TABLE, }); + // The grants run after the migration has committed, in a statement of + // their own. Once an incremental migration adds a table a consumer uses, + // a consumer that starts in between can see the new version, pass its + // schema wait and get "permission denied" on the new table until this + // call lands a moment later. That is acceptable: the window lasts one + // function call under the migration lock, and a refused query fails one + // request, one sweep run or one start (which the restart policy repeats) + // rather than writing anything wrong; the next attempt succeeds. A + // migration that must close it re-creates conditions.grant_consumer_roles() + // with the new table and calls it in the same file, which the custom + // migration's statement-kind test must then allow. + await grantConsumerRoles(client); } finally { try { if (locked) { @@ -73,3 +99,32 @@ export async function runMigrations(connectionString: string): Promise { } } } + +/** + * Runs `conditions.grant_consumer_roles()`, which grants each consumer role + * that exists exactly what it uses; re-granting changes nothing. A grant + * rewrites catalog rows another session of the same role (the federation + * service maintaining partitions) may be updating at that moment, which + * PostgreSQL refuses with "tuple concurrently updated"; that is tried once + * more. + */ +export async function grantConsumerRoles(client: postgres.Sql): Promise { + for (let attempt = 1; ; attempt++) { + try { + await client`SELECT conditions.grant_consumer_roles()`; + return; + } catch (error) { + if (attempt > 1 || !isConcurrentCatalogUpdate(error)) throw error; + } + } +} + +function isConcurrentCatalogUpdate(error: unknown): boolean { + const { code, message } = error as { code?: unknown; message?: unknown }; + return ( + code === "40001" || + (code === "XX000" && + typeof message === "string" && + message.includes("tuple concurrently updated")) + ); +} diff --git a/packages/core/src/db/observation-schema.ts b/packages/core/src/db/observation-schema.ts index cb8496bac..c63ed7388 100644 --- a/packages/core/src/db/observation-schema.ts +++ b/packages/core/src/db/observation-schema.ts @@ -2,7 +2,6 @@ import { ACCESS_MODES, EVIDENCE_STATES, enumCheckSql } from "@openconditions/mod import { sql } from "drizzle-orm"; import { bigint, - bigserial, boolean, check, date, @@ -60,74 +59,85 @@ export const contributorReceipt = conditionsSchema.table("contributor_receipt", export const observationLatest = conditionsSchema.table( "observation_latest", + // Fixed-width columns first, widest alignment first, then the + // variable-length ones, the reading and template last: no row pays + // alignment padding. { - seriesId: bigserial("series_id", { mode: "number" }).primaryKey(), + seriesId: bigint("series_id", { mode: "number" }).primaryKey().generatedByDefaultAsIdentity(), + effectiveFrom: tstz("effective_from").notNull(), + sinceAt: tstz("since_at").notNull(), + updatedAt: tstz("updated_at").notNull().defaultNow(), + effectiveUntil: tstz("effective_until"), + expiresAt: tstz("expires_at"), + valueNum: doublePrecision("value_num"), + confidenceScore: doublePrecision("confidence_score"), + corroborations: integer("corroborations").notNull().default(0), + retentionDays: smallint("retention_days"), + fusedPublic: boolean("fused_public"), subjectKey: text("subject_key").notNull(), property: text("property").notNull(), qualifierKey: text("qualifier_key").notNull().default(""), sourceId: text("source_id").notNull(), subjectKind: text("subject_kind").notNull(), + accessMode: text("access_mode").notNull(), + resultType: text("result_type").notNull(), + templateHash: text("template_hash").notNull(), featureId: text("feature_id"), componentKey: text("component_key"), situationId: text("situation_id"), - geom: geometry("geom"), - reading: jsonb("reading").notNull(), - template: jsonb("template").notNull(), - templateHash: text("template_hash").notNull(), - contributorReceiptId: text("contributor_receipt_id"), /** A crowd row's record id (null on every other row, so no feed update changes an indexed value). */ crowdRecordId: text("crowd_record_id"), - accessMode: text("access_mode").notNull(), - resultType: text("result_type").notNull(), - valueNum: doublePrecision("value_num"), + contributorReceiptId: text("contributor_receipt_id"), valueMoney: numeric("value_money", { precision: 14, scale: 4 }), valueText: text("value_text"), unit: text("unit"), currency: text("currency"), - effectiveFrom: tstz("effective_from").notNull(), - effectiveUntil: tstz("effective_until"), - sinceAt: tstz("since_at").notNull(), fusedFrom: text("fused_from").array(), /** A fused row's contributing sources (their rows' `source_id`), in contributor order without repeats. */ fusedSources: text("fused_sources").array(), - fusedPublic: boolean("fused_public"), evidenceState: text("evidence_state"), - confidenceScore: doublePrecision("confidence_score"), - corroborations: integer("corroborations").notNull().default(0), - expiresAt: tstz("expires_at"), - retentionDays: smallint("retention_days"), - updatedAt: tstz("updated_at").notNull().defaultNow(), + geom: geometry("geom"), + reading: jsonb("reading").notNull(), + template: jsonb("template").notNull(), }, (t) => [ - unique("observation_latest_series").on(t.subjectKey, t.property, t.qualifierKey, t.sourceId), + // A series is its subject, property, qualifiers and source. + unique("observation_latest_series_key").on( + t.subjectKey, + t.property, + t.qualifierKey, + t.sourceId, + ), check( - "observation_latest_access_mode_enum", + "observation_latest_access_mode_check", sql.raw(enumCheckSql("access_mode", ACCESS_MODES)), ), check( - "observation_latest_evidence_state_enum", + "observation_latest_evidence_state_check", sql.raw(`evidence_state IS NULL OR ${enumCheckSql("evidence_state", EVIDENCE_STATES)}`), ), - index("idx_observation_latest_geom").using("gist", t.geom), + index("observation_latest_geom_idx").using("gist", t.geom), // Leads with the property, so it serves a filter by property alone too. - index("idx_observation_latest_property_text").on(t.property, t.valueText), + index("observation_latest_property_value_text_idx").on(t.property, t.valueText), // A poll compares its readings with every series of its source; the // federation reconcile pages them by series id. Neither column changes // on a reading's update, which stays heap-only. - index("idx_observation_latest_source").on(t.sourceId, t.seriesId), - index("idx_observation_latest_component").on(t.featureId, t.componentKey), - index("idx_observation_latest_fuel_price") + index("observation_latest_source_id_series_id_idx").on(t.sourceId, t.seriesId), + index("observation_latest_feature_id_component_key_idx").on(t.featureId, t.componentKey), + index("observation_latest_value_money_fuel_price_idx") .on(t.valueMoney) .where(sql`${t.property} = 'fuel.price'`), - index("idx_observation_latest_expires").on(t.expiresAt).where(sql`${t.expiresAt} IS NOT NULL`), + index("observation_latest_expires_at_idx") + .on(t.expiresAt) + .where(sql`${t.expiresAt} IS NOT NULL`), // Reads of readings since an instant (the last day's fire pixels). BRIN // summarizes block ranges, so a reading's update stays heap-only; a btree // on what every reading changes would not. - index("idx_observation_latest_effective_brin").using("brin", t.effectiveFrom), + index("observation_latest_effective_from_idx").using("brin", t.effectiveFrom), // A crowd report is found by its record id: votes, replays and re-keying // name it. Indexing an expression over `reading` would change with every // reading of every series and keep their updates from being HOT. - index("idx_observation_latest_crowd_record") + index("observation_latest_crowd_record_id_idx") .on(t.crowdRecordId) .where(sql`${t.crowdRecordId} IS NOT NULL`), ], @@ -137,26 +147,27 @@ export const observationLatest = conditionsSchema.table( export const observationRollupHourly = conditionsSchema.table( "observation_rollup_hourly", { + // Fixed-width columns first, as in observation_latest. seriesId: bigint("series_id", { mode: "number" }).notNull(), hourUtc: tstz("hour_utc").notNull(), + min: doublePrecision("min").notNull(), + max: doublePrecision("max").notNull(), + mean: doublePrecision("mean").notNull(), sampleCount: integer("sample_count").notNull(), + lineageComplete: boolean("lineage_complete").notNull().default(false), /** Distinct immutable receipt IDs of every sample in this bucket. */ contributorReceiptIds: text("contributor_receipt_ids").array(), - lineageComplete: boolean("lineage_complete").notNull().default(false), bins: smallint("bins").array(), counts: integer("counts").array(), - min: doublePrecision("min").notNull(), - max: doublePrecision("max").notNull(), - mean: doublePrecision("mean").notNull(), }, (t) => [ - primaryKey({ columns: [t.seriesId, t.hourUtc] }), + primaryKey({ name: "observation_rollup_hourly_pkey", columns: [t.seriesId, t.hourUtc] }), foreignKey({ - name: "observation_rollup_hourly_series_fk", + name: "observation_rollup_hourly_series_id_fkey", columns: [t.seriesId], foreignColumns: [observationLatest.seriesId], }).onDelete("cascade"), - index("idx_observation_rollup_hourly_hour").on(t.hourUtc), + index("observation_rollup_hourly_hour_utc_idx").on(t.hourUtc), ], ); @@ -175,13 +186,13 @@ export const observationRollupDaily = conditionsSchema.table( mean: doublePrecision("mean").notNull(), }, (t) => [ - primaryKey({ columns: [t.seriesId, t.dayUtc] }), + primaryKey({ name: "observation_rollup_daily_pkey", columns: [t.seriesId, t.dayUtc] }), foreignKey({ - name: "observation_rollup_daily_series_fk", + name: "observation_rollup_daily_series_id_fkey", columns: [t.seriesId], foreignColumns: [observationLatest.seriesId], }).onDelete("cascade"), - index("idx_observation_rollup_daily_day").on(t.dayUtc), + index("observation_rollup_daily_day_utc_idx").on(t.dayUtc), ], ); diff --git a/packages/core/src/db/raw-schema.ts b/packages/core/src/db/raw-schema.ts index 4ac52c451..3f793b3aa 100644 --- a/packages/core/src/db/raw-schema.ts +++ b/packages/core/src/db/raw-schema.ts @@ -38,10 +38,14 @@ export const rawPayload = conditionsSchema.table( evictedAt: tstz("evicted_at"), }, (t) => [ - primaryKey({ name: "raw_payload_pk", columns: [t.sourceId, t.hash] }), - check("raw_payload_tier_enum", sql.raw(enumCheckSql("tier", RAW_TIERS))), - index("idx_raw_payload_source_time").on(t.sourceId, t.firstFetchedAt), - index("idx_raw_payload_tier_seen").on(t.tier, t.lastSeenAt).where(sql`${t.evictedAt} IS NULL`), - index("idx_raw_payload_base").on(t.sourceId, t.baseHash).where(sql`${t.baseHash} IS NOT NULL`), + primaryKey({ name: "raw_payload_pkey", columns: [t.sourceId, t.hash] }), + check("raw_payload_tier_check", sql.raw(enumCheckSql("tier", RAW_TIERS))), + index("raw_payload_source_id_first_fetched_at_idx").on(t.sourceId, t.firstFetchedAt), + index("raw_payload_tier_last_seen_at_idx") + .on(t.tier, t.lastSeenAt) + .where(sql`${t.evictedAt} IS NULL`), + index("raw_payload_source_id_base_hash_idx") + .on(t.sourceId, t.baseHash) + .where(sql`${t.baseHash} IS NOT NULL`), ], ); diff --git a/packages/core/src/db/record-schema.ts b/packages/core/src/db/record-schema.ts index f151e160c..aa564f52b 100644 --- a/packages/core/src/db/record-schema.ts +++ b/packages/core/src/db/record-schema.ts @@ -24,6 +24,7 @@ import { boolean, check, doublePrecision, + foreignKey, index, integer, jsonb, @@ -85,16 +86,29 @@ function kernelColumns() { /** The kernel-closed CHECKs of a class table, named after it. */ function kernelChecks(table: string) { return [ - check(`${table}_temporality_enum`, sql.raw(enumCheckSql("temporality", TEMPORALITIES))), - check(`${table}_origin_enum`, sql.raw(enumCheckSql("origin", ORIGINS))), - check(`${table}_access_mode_enum`, sql.raw(enumCheckSql("access_mode", ACCESS_MODES))), - check(`${table}_privacy_class_enum`, sql.raw(enumCheckSql("privacy_class", PRIVACY_CLASSES))), - check(`${table}_tombstone_reason_enum`, nullableEnum("tombstone_reason", TOMBSTONE_REASONS)), + check(`${table}_temporality_check`, sql.raw(enumCheckSql("temporality", TEMPORALITIES))), + check(`${table}_origin_check`, sql.raw(enumCheckSql("origin", ORIGINS))), + check(`${table}_access_mode_check`, sql.raw(enumCheckSql("access_mode", ACCESS_MODES))), + check(`${table}_privacy_class_check`, sql.raw(enumCheckSql("privacy_class", PRIVACY_CLASSES))), + check(`${table}_tombstone_reason_check`, nullableEnum("tombstone_reason", TOMBSTONE_REASONS)), check( - `${table}_tombstone_complete`, + `${table}_tombstone_check`, sql.raw("(tombstone_reason IS NULL) = (tombstoned_at IS NULL)"), ), - check(`${table}_revision_positive`, sql.raw("revision > 0")), + check(`${table}_revision_check`, sql.raw("revision > 0")), + ]; +} + +/** + * What the records sweep looks up every few minutes: live records past their + * expiry, and tombstones old enough to purge. + */ +function sweepIndexes(table: string, t: { expiresAt: AnyPgColumn; tombstonedAt: AnyPgColumn }) { + return [ + index(`${table}_expires_at_idx`).on(t.expiresAt).where(sql`${t.tombstonedAt} IS NULL`), + index(`${table}_tombstoned_at_idx`) + .on(t.tombstonedAt) + .where(sql`${t.tombstonedAt} IS NOT NULL`), ]; } @@ -103,15 +117,20 @@ function revisionTable(table: string, parentColumn: string, parent: () => AnyPgC return conditionsSchema.table( `${table}_revision`, { - parentId: text(parentColumn).notNull().references(parent, { onDelete: "cascade" }), + parentId: text(parentColumn).notNull(), revision: integer("revision").notNull(), recordedAt: tstz("recorded_at").notNull(), changeKinds: text("change_kinds").array().notNull(), snapshot: jsonb("snapshot").notNull(), }, (t) => [ - primaryKey({ columns: [t.parentId, t.revision] }), - index(`idx_${table}_revision_recorded`).on(t.recordedAt), + primaryKey({ name: `${table}_revision_pkey`, columns: [t.parentId, t.revision] }), + foreignKey({ + name: `${table}_revision_${parentColumn}_fkey`, + columns: [t.parentId], + foreignColumns: [parent()], + }).onDelete("cascade"), + index(`${table}_revision_recorded_at_idx`).on(t.recordedAt), ], ); } @@ -137,35 +156,37 @@ export const situation = conditionsSchema.table( }, (t) => [ ...kernelChecks("situation"), - check("situation_severity_enum", sql.raw(enumCheckSql("severity", SEVERITY_LABELS))), + check("situation_severity_check", sql.raw(enumCheckSql("severity", SEVERITY_LABELS))), check( - "situation_severity_level_range", + "situation_severity_level_check", sql`${t.severityLevel} IS NULL OR ${t.severityLevel} BETWEEN 1 AND 5`, ), - check("situation_certainty_enum", sql.raw(enumCheckSql("certainty", CERTAINTIES))), + check("situation_certainty_check", sql.raw(enumCheckSql("certainty", CERTAINTIES))), check( - "situation_validity_status_enum", + "situation_validity_status_check", sql.raw(enumCheckSql("validity_status", VALIDITY_STATUSES)), ), - check("situation_evidence_state_enum", nullableEnum("evidence_state", EVIDENCE_STATES)), - index("idx_situation_geom").using("gist", t.geom), - index("idx_situation_kind_type").on(t.kind, t.type), + check("situation_evidence_state_check", nullableEnum("evidence_state", EVIDENCE_STATES)), + index("situation_geom_idx").using("gist", t.geom), + index("situation_kind_type_idx").on(t.kind, t.type), // A source's records, paged by id (the federation reconcile). - index("idx_situation_source").on(t.sourceId, t.id), - index("idx_situation_canonical").on(t.canonicalId), - index("idx_situation_valid_to").on(t.validTo), - index("idx_situation_expires").on(t.expiresAt), - index("idx_situation_group").on(t.groupId), - index("idx_situation_crowd_evidence") - .on(t.origin, t.evidenceState) + index("situation_source_id_id_idx").on(t.sourceId, t.id), + index("situation_canonical_id_idx").on(t.canonicalId), + index("situation_valid_to_idx").on(t.validTo), + index("situation_expires_at_idx").on(t.expiresAt), + index("situation_group_id_idx").on(t.groupId), + index("situation_evidence_state_crowd_idx") + .on(t.evidenceState) .where(sql`${t.origin} = 'crowd'`), - index("idx_situation_tombstoned").on(t.tombstonedAt).where(sql`${t.tombstonedAt} IS NOT NULL`), + index("situation_tombstoned_at_idx") + .on(t.tombstonedAt) + .where(sql`${t.tombstonedAt} IS NOT NULL`), // The nightly archive prune looks up the erased records. - index("idx_situation_rights_revoked") + index("situation_id_rights_revoked_idx") .on(t.id) .where(sql`${t.tombstoneReason} = 'rights_revoked'`), // Records in byte order of their ids, as federation lists them to compare state. - index("idx_situation_id_bytes").on(sql`${t.id} COLLATE "C"`), + index("situation_id_bytes_idx").on(sql`${t.id} COLLATE "C"`), ], ); @@ -176,9 +197,7 @@ export const situation = conditionsSchema.table( export const situationEffect = conditionsSchema.table( "situation_effect", { - situationId: text("situation_id") - .notNull() - .references(() => situation.id, { onDelete: "cascade" }), + situationId: text("situation_id").notNull(), effectId: text("effect_id").notNull(), phaseId: text("phase_id").notNull().default(""), kind: text("kind").notNull(), @@ -192,18 +211,23 @@ export const situationEffect = conditionsSchema.table( value: jsonb("value").notNull(), }, (t) => [ - primaryKey({ columns: [t.situationId, t.effectId] }), + primaryKey({ name: "situation_effect_pkey", columns: [t.situationId, t.effectId] }), + foreignKey({ + name: "situation_effect_situation_id_fkey", + columns: [t.situationId], + foreignColumns: [situation.id], + }).onDelete("cascade"), check( - "situation_effect_applicability_enum", + "situation_effect_applicability_kind_check", sql.raw(enumCheckSql("applicability_kind", APPLICABILITY_KINDS)), ), check( - "situation_effect_normalization_enum", + "situation_effect_normalization_check", sql.raw(enumCheckSql("normalization", NORMALIZATION)), ), - check("situation_effect_compliance_enum", sql.raw(enumCheckSql("compliance", COMPLIANCE))), - index("idx_situation_effect_kind_valid_to").on(t.kind, t.validTo), - index("idx_situation_effect_geom").using("gist", t.geom), + check("situation_effect_compliance_check", sql.raw(enumCheckSql("compliance", COMPLIANCE))), + index("situation_effect_kind_valid_to_idx").on(t.kind, t.validTo), + index("situation_effect_geom_idx").using("gist", t.geom), ], ); @@ -218,24 +242,25 @@ export const feature = conditionsSchema.table( }, (t) => [ ...kernelChecks("feature"), - check("feature_lifecycle_enum", sql.raw(enumCheckSql("lifecycle", LIFECYCLES))), - index("idx_feature_geom").using("gist", t.geom), - index("idx_feature_kind_type").on(t.kind, t.type), - index("idx_feature_source").on(t.sourceId, t.id), - index("idx_feature_canonical").on(t.canonicalId), - index("idx_feature_kind_lifecycle").on(t.kind, t.lifecycle), + check("feature_lifecycle_check", sql.raw(enumCheckSql("lifecycle", LIFECYCLES))), + index("feature_geom_idx").using("gist", t.geom), + index("feature_kind_type_idx").on(t.kind, t.type), + index("feature_source_id_id_idx").on(t.sourceId, t.id), + index("feature_canonical_id_idx").on(t.canonicalId), + index("feature_kind_lifecycle_idx").on(t.kind, t.lifecycle), + ...sweepIndexes("feature", t), // Linking finds the features that share an external id with a written one, // one id at a time, often in the transaction that just wrote them: entries // go into the index directly, as a pending list would be scanned whole on // every lookup. - index("idx_feature_external_ids") + index("feature_external_ids_idx") .using("gin", sql`(${t.record} -> 'externalIds') jsonb_path_ops`) .with({ fastupdate: "off" }), - index("idx_feature_rights_revoked") + index("feature_id_rights_revoked_idx") .on(t.id) .where(sql`${t.tombstoneReason} = 'rights_revoked'`), // Records in byte order of their ids, as federation lists them to compare state. - index("idx_feature_id_bytes").on(sql`${t.id} COLLATE "C"`), + index("feature_id_bytes_idx").on(sql`${t.id} COLLATE "C"`), ], ); @@ -247,9 +272,7 @@ export const feature = conditionsSchema.table( export const featureComponent = conditionsSchema.table( "feature_component", { - featureId: text("feature_id") - .notNull() - .references(() => feature.id, { onDelete: "cascade" }), + featureId: text("feature_id").notNull(), key: text("key").notNull(), parentKey: text("parent_key"), kind: text("kind").notNull(), @@ -260,10 +283,15 @@ export const featureComponent = conditionsSchema.table( contentHash: text("content_hash").notNull(), }, (t) => [ - primaryKey({ columns: [t.featureId, t.key] }), - check("feature_component_lifecycle_enum", nullableEnum("lifecycle", LIFECYCLES)), - index("idx_feature_component_kind").on(t.kind), - index("idx_feature_component_external_ids").using("gin", t.externalIds.op("jsonb_path_ops")), + primaryKey({ name: "feature_component_pkey", columns: [t.featureId, t.key] }), + foreignKey({ + name: "feature_component_feature_id_fkey", + columns: [t.featureId], + foreignColumns: [feature.id], + }).onDelete("cascade"), + check("feature_component_lifecycle_check", nullableEnum("lifecycle", LIFECYCLES)), + index("feature_component_kind_idx").on(t.kind), + index("feature_component_external_ids_idx").using("gin", t.externalIds.op("jsonb_path_ops")), ], ); @@ -282,12 +310,12 @@ export const featureLink = conditionsSchema.table( decidedAt: tstz("decided_at").notNull(), }, (t) => [ - primaryKey({ columns: [t.aId, t.bId] }), + primaryKey({ name: "feature_link_pkey", columns: [t.aId, t.bId] }), // Code point order, as the model orders a pair, whatever the database's collation. - check("feature_link_ordered", sql`${t.aId} < ${t.bId} COLLATE "C"`), - check("feature_link_method_enum", sql.raw(enumCheckSql("method", LINK_METHODS))), - check("feature_link_status_enum", sql.raw(enumCheckSql("status", LINK_STATUSES))), - index("idx_feature_link_b").on(t.bId), + check("feature_link_order_check", sql`${t.aId} < ${t.bId} COLLATE "C"`), + check("feature_link_method_check", sql.raw(enumCheckSql("method", LINK_METHODS))), + check("feature_link_status_check", sql.raw(enumCheckSql("status", LINK_STATUSES))), + index("feature_link_b_id_idx").on(t.bId), ], ); @@ -311,7 +339,7 @@ export const featureCanonical = conditionsSchema.table( computedAt: tstz("computed_at").notNull(), }, (t) => [ - index("idx_feature_canonical_members").using("gin", t.memberIds).with({ fastupdate: "off" }), + index("feature_canonical_member_ids_idx").using("gin", t.memberIds).with({ fastupdate: "off" }), ], ); @@ -331,15 +359,18 @@ export const offer = conditionsSchema.table( }, (t) => [ ...kernelChecks("offer"), - check("offer_subject_class_enum", sql.raw(enumCheckSql("subject_class", RECORD_CLASSES))), - index("idx_offer_subject").on(t.subjectId, t.componentKey), - index("idx_offer_kind_valid_to").on(t.kind, t.validTo), - index("idx_offer_geom").using("gist", t.geom), - index("idx_offer_source").on(t.sourceId, t.id), - index("idx_offer_canonical").on(t.canonicalId), - index("idx_offer_rights_revoked").on(t.id).where(sql`${t.tombstoneReason} = 'rights_revoked'`), + check("offer_subject_class_check", sql.raw(enumCheckSql("subject_class", RECORD_CLASSES))), + index("offer_subject_id_component_key_idx").on(t.subjectId, t.componentKey), + index("offer_kind_valid_to_idx").on(t.kind, t.validTo), + index("offer_geom_idx").using("gist", t.geom), + index("offer_source_id_id_idx").on(t.sourceId, t.id), + index("offer_canonical_id_idx").on(t.canonicalId), + ...sweepIndexes("offer", t), + index("offer_id_rights_revoked_idx") + .on(t.id) + .where(sql`${t.tombstoneReason} = 'rights_revoked'`), // Records in byte order of their ids, as federation lists them to compare state. - index("idx_offer_id_bytes").on(sql`${t.id} COLLATE "C"`), + index("offer_id_bytes_idx").on(sql`${t.id} COLLATE "C"`), ], ); @@ -361,12 +392,12 @@ export const recordRelation = conditionsSchema.table( }, (t) => [ primaryKey({ - name: "record_relation_pk", + name: "record_relation_pkey", columns: [t.fromClass, t.fromId, t.relation, t.toClass, t.toId, t.componentKey], }), - check("record_relation_from_class_enum", sql.raw(enumCheckSql("from_class", RECORD_CLASSES))), - check("record_relation_to_class_enum", sql.raw(enumCheckSql("to_class", RECORD_CLASSES))), - check("record_relation_relation_enum", sql.raw(enumCheckSql("relation", RELATIONS))), - index("idx_record_relation_to").on(t.toClass, t.toId), + check("record_relation_from_class_check", sql.raw(enumCheckSql("from_class", RECORD_CLASSES))), + check("record_relation_to_class_check", sql.raw(enumCheckSql("to_class", RECORD_CLASSES))), + check("record_relation_relation_check", sql.raw(enumCheckSql("relation", RELATIONS))), + index("record_relation_to_class_to_id_idx").on(t.toClass, t.toId), ], ); diff --git a/packages/core/src/db/registry-coverage.ts b/packages/core/src/db/registry-coverage.ts index 54c7e9288..6e5bb2731 100644 --- a/packages/core/src/db/registry-coverage.ts +++ b/packages/core/src/db/registry-coverage.ts @@ -28,7 +28,7 @@ export async function storedRegistryCodes(sql: postgres.Sql): Promise } /** - * The boot check every service runs after migrating: fail when the database + * The boot check every service runs once the schema is migrated: fail when the database * holds a code the running registry does not register, instead of serving or * federating rows no schema describes. The caller passes the assembled * production registry (core never imports it). diff --git a/packages/core/src/db/schema-version.ts b/packages/core/src/db/schema-version.ts new file mode 100644 index 000000000..ccea1d96b --- /dev/null +++ b/packages/core/src/db/schema-version.ts @@ -0,0 +1,151 @@ +import { readFileSync } from "node:fs"; +import { join } from "node:path"; +import { setTimeout as sleep } from "node:timers/promises"; +import type { Sql } from "postgres"; +import { MIGRATIONS_SCHEMA, MIGRATIONS_TABLE, resolveMigrationsFolder } from "./migrate.js"; + +/** How long a service waits for the schema when its configuration names no other limit. */ +export const DEFAULT_SCHEMA_WAIT_TIMEOUT_MS = 5 * 60_000; + +/** How often the migration history is read while the schema is behind. */ +const DEFAULT_POLL_MS = 2_000; + +const HISTORY = `${MIGRATIONS_SCHEMA}.${MIGRATIONS_TABLE}`; + +/** The latest migration this build ships: its journal tag and `when`. */ +export interface SchemaVersion { + tag: string; + when: number; +} + +/** + * What the database holds: the latest recorded migration's `when`, an empty + * history, no history table (or no `conditions` schema) yet, or a history the + * role may not read. + */ +export type AppliedSchemaVersion = + | { state: "applied"; when: number } + | { state: "empty" } + | { state: "absent" } + | { state: "unreadable"; detail: string }; + +/** + * The latest entry of the migrations journal this build carries. Every image + * ships the migrations folder next to its entry, as the ingest service's + * migrator reads it, so the services that do not migrate read the same file. + */ +export function expectedSchemaVersion(folder: string = resolveMigrationsFolder()): SchemaVersion { + const journal = JSON.parse(readFileSync(join(folder, "meta", "_journal.json"), "utf8")) as { + entries?: { tag?: unknown; when?: unknown }[]; + }; + const last = journal.entries?.at(-1); + if (typeof last?.tag !== "string" || typeof last.when !== "number") { + throw new Error(`the migrations journal in ${folder} has no entry with a tag and a time`); + } + return { tag: last.tag, when: last.when }; +} + +/** Reads the latest recorded migration, telling a missing or unreadable history apart. */ +export async function appliedSchemaVersion(sql: Sql): Promise { + try { + const [row] = await sql<{ latest: string | null }[]>` + SELECT max(created_at)::text AS latest FROM ${sql(MIGRATIONS_SCHEMA)}.${sql(MIGRATIONS_TABLE)}`; + if (row?.latest == null) return { state: "empty" }; + return { state: "applied", when: Number(row.latest) }; + } catch (error) { + const code = (error as { code?: unknown }).code; + // invalid_schema_name, undefined_table: the ingest service has not migrated yet. + if (code === "3F000" || code === "42P01") return { state: "absent" }; + // insufficient_privilege: the grant arrives with the migrations, so this + // too can be a database the ingest service is still migrating. + if (code === "42501") { + return { state: "unreadable", detail: (error as Error).message }; + } + throw error; + } +} + +function describe(found: AppliedSchemaVersion): string { + switch (found.state) { + case "applied": + return `the latest recorded migration has when ${found.when}`; + case "empty": + return `${HISTORY} is empty`; + case "absent": + return `${HISTORY} does not exist`; + case "unreadable": + return `${HISTORY} cannot be read by this role (${found.detail}); it needs USAGE on the schema conditions and SELECT on the table`; + } +} + +export interface WaitForSchemaVersionOptions { + /** How long to wait before giving up. */ + timeoutMs: number; + /** How often to read the history while waiting; 2 s. */ + pollMs?: number; + /** + * Called with what a read found while the schema is behind: at the first + * such read, and again whenever a read finds something else, such as a + * history that now exists but which this role may not read. + */ + onWait?: (found: string, expected: SchemaVersion) => void; + /** The migrations folder whose journal names the expected version; the bundled one. */ + migrationsFolder?: string; +} + +/** + * Resolves once the ingest service has migrated the database at least to the + * latest migration this build ships: `max(created_at)` in + * `conditions.__drizzle_migrations` is at least that journal entry's `when`. + * A newer schema, from a newer ingest, satisfies it too. A missing schema, + * table or grant counts as not yet migrated. Needs no DDL right: only USAGE + * on `conditions` and SELECT on the history table. Throws after `timeoutMs`, + * saying which version it expected and what it found. + */ +export async function waitForSchemaVersion( + sql: Sql, + options: WaitForSchemaVersionOptions, +): Promise { + const expected = expectedSchemaVersion(options.migrationsFolder); + const pollMs = options.pollMs ?? DEFAULT_POLL_MS; + const deadline = Date.now() + options.timeoutMs; + let told: string | undefined; + for (;;) { + const found = await appliedSchemaVersion(sql); + if (found.state === "applied" && found.when >= expected.when) return; + const left = deadline - Date.now(); + if (left <= 0) { + throw new Error( + `the database schema did not reach this build's version within ${options.timeoutMs} ms: ` + + `expected a migration in ${HISTORY} with when ${expected.when} (${expected.tag}) or later, ` + + `but ${describe(found)}. The ingest service applies the migrations; check that it runs ` + + "this release or a newer one and that its migration succeeded" + + (found.state === "unreadable" + ? ". A role created after the ingest service last started gets its grants when the " + + "ingest service restarts: restart it, and check that this role exists under the name " + + "the ingest service grants to" + : ""), + ); + } + const seen = describe(found); + if (seen !== told) { + options.onWait?.(seen, expected); + told = seen; + } + await sleep(Math.min(pollMs, left)); + } +} + +/** + * The wait timeout a service reads from its configuration: a whole number of + * milliseconds above 0, or the default when the variable is unset or empty. + */ +export function schemaWaitTimeoutMs(env: NodeJS.ProcessEnv, variable: string): number { + const raw = env[variable]?.trim(); + if (raw == null || raw === "") return DEFAULT_SCHEMA_WAIT_TIMEOUT_MS; + const value = Number(raw); + if (!/^\d+$/.test(raw) || !Number.isSafeInteger(value) || value <= 0) { + throw new Error(`${variable} must be a whole number of milliseconds above 0, got "${raw}"`); + } + return value; +} diff --git a/packages/core/src/db/schema.ts b/packages/core/src/db/schema.ts index 2f77fcd54..7cdffe789 100644 --- a/packages/core/src/db/schema.ts +++ b/packages/core/src/db/schema.ts @@ -1,18 +1,12 @@ -import { - EVIDENCE_STATES, - enumCheckSql, - FUZZINESS, - PRIVACY_CLASSES, - RECORD_CLASSES, -} from "@openconditions/model"; +import { enumCheckSql, RECORD_CLASSES, TOMBSTONE_REASONS } from "@openconditions/model"; import { sql } from "drizzle-orm"; import { bigint, - bigserial, boolean, check, date, doublePrecision, + foreignKey, index, integer, jsonb, @@ -21,11 +15,23 @@ import { smallint, text, timestamp, - unique, uniqueIndex, uuid, } from "drizzle-orm/pg-core"; -import { bytea, conditionsSchema, geometry, geometryPoint, xid8 } from "./columns.js"; +import { bytea, conditionsSchema, geometry, sealedSecretCheck, xid8 } from "./columns.js"; + +/** A segment's level of service, worst last but `unknown`. */ +export const SEGMENT_LOS = [ + "free_flow", + "heavy", + "queuing", + "stationary", + "blocked", + "unknown", +] as const; + +/** How a segment speed was obtained: measured on the segment, or propagated from a neighbour. */ +export const SEGMENT_SPEED_CONFIDENCES = ["measured", "estimated"] as const; /** * One row per feed source, updated on every poll cycle (including a 304/ @@ -88,8 +94,8 @@ export const sourceShrink = conditionsSchema.table( held: integer("held").notNull(), }, (t) => [ - primaryKey({ columns: [t.sourceId, t.scope] }), - check("source_shrink_scope_enum", sql`${t.scope} IN ('series','records')`), + primaryKey({ name: "source_shrink_pkey", columns: [t.sourceId, t.scope] }), + check("source_shrink_scope_check", sql`${t.scope} IN ('series','records')`), ], ); @@ -98,7 +104,7 @@ export const sourceShrink = conditionsSchema.table( export const sourcePollAttempt = conditionsSchema.table( "source_poll_attempt", { - id: bigserial("id", { mode: "number" }).primaryKey(), + id: bigint("id", { mode: "number" }).primaryKey().generatedByDefaultAsIdentity(), source: text("source").notNull(), attemptedAt: timestamp("attempted_at", { withTimezone: true }).notNull(), /** Null while the poll is still running: its id is the fetch id its raw payloads are filed under. */ @@ -120,8 +126,8 @@ export const sourcePollAttempt = conditionsSchema.table( payloadHashes: text("payload_hashes").array(), }, (t) => [ - index("idx_source_poll_attempt_source_time").on(t.source, t.attemptedAt), - index("idx_source_poll_attempt_time").on(t.attemptedAt, t.id), + index("source_poll_attempt_source_attempted_at_idx").on(t.source, t.attemptedAt), + index("source_poll_attempt_attempted_at_id_idx").on(t.attemptedAt, t.id), ], ); @@ -149,8 +155,15 @@ export const sensorBaseline = conditionsSchema.table( computedAt: timestamp("computed_at", { withTimezone: true }).notNull(), }, (t) => [ - primaryKey({ columns: [t.subjectKey, t.dowBucket, t.todBucket, t.method] }), - index("idx_sensor_baseline_source_bucket").on(t.source, t.dowBucket, t.todBucket), + primaryKey({ + name: "sensor_baseline_pkey", + columns: [t.subjectKey, t.dowBucket, t.todBucket, t.method], + }), + index("sensor_baseline_source_dow_bucket_tod_bucket_idx").on( + t.source, + t.dowBucket, + t.todBucket, + ), ], ); @@ -175,9 +188,9 @@ export const osmRoad = conditionsSchema.table( importedAt: timestamp("imported_at", { withTimezone: true }).notNull(), }, (t) => [ - index("idx_osm_road_geom").using("gist", t.geom), - index("idx_osm_road_highway").on(t.highway), - index("idx_osm_road_ref").on(t.ref), + index("osm_road_geom_idx").using("gist", t.geom), + index("osm_road_highway_idx").on(t.highway), + index("osm_road_ref_idx").on(t.ref), ], ); @@ -201,9 +214,9 @@ export const roadSegment = conditionsSchema.table( computedAt: timestamp("computed_at", { withTimezone: true }).notNull(), }, (t) => [ - index("idx_road_segment_geom").using("gist", t.geom), - index("idx_road_segment_way").on(t.wayId), - index("idx_road_segment_minzoom").on(t.minZoom), + index("road_segment_geom_idx").using("gist", t.geom), + index("road_segment_way_id_idx").on(t.wayId), + index("road_segment_min_zoom_idx").on(t.minZoom), ], ); @@ -221,7 +234,7 @@ export const sensorSegment = conditionsSchema.table( bearingDeg: doublePrecision("bearing_deg"), matchedAt: timestamp("matched_at", { withTimezone: true }).notNull(), }, - (t) => [index("idx_sensor_segment_segment").on(t.segmentId)], + (t) => [index("sensor_segment_segment_id_idx").on(t.segmentId)], ); /** Singleton identity and provenance of the segment spine currently active. */ @@ -237,7 +250,7 @@ export const roadGraphState = conditionsSchema.table( importedAt: timestamp("imported_at", { withTimezone: true }).notNull(), activatedAt: timestamp("activated_at", { withTimezone: true }).notNull(), }, - (t) => [check("road_graph_state_singleton", sql`${t.singleton} IS TRUE`)], + (t) => [check("road_graph_state_singleton_check", sql`${t.singleton} IS TRUE`)], ); /** Current reviewed public licence policy, refreshed atomically with the source catalogue. */ @@ -263,7 +276,8 @@ export const segmentObservation = conditionsSchema.table( freeFlowKph: doublePrecision("free_flow_kph"), speedRatio: doublePrecision("speed_ratio"), los: text("los").notNull(), - confidence: doublePrecision("confidence").notNull(), + /** How far the source trusts its own reading, 0 to 1. */ + confidenceScore: doublePrecision("confidence_score").notNull(), sampleCount: integer("sample_count"), /** Selected native identities and captured display receipts; rights stay in contributing. */ nativeFieldSources: jsonb("native_field_sources"), @@ -276,8 +290,8 @@ export const segmentObservation = conditionsSchema.table( expiresAt: timestamp("expires_at", { withTimezone: true }), }, (t) => [ - primaryKey({ columns: [t.segmentId, t.source] }), - index("idx_segment_observation_segment").on(t.segmentId), + primaryKey({ name: "segment_observation_pkey", columns: [t.segmentId, t.source] }), + check("segment_observation_los_check", sql.raw(enumCheckSql("los", SEGMENT_LOS))), ], ); @@ -302,10 +316,7 @@ export const segmentProfile = conditionsSchema.table( contributing: text("contributing").array().notNull().default(sql`'{}'::text[]`), computedAt: timestamp("computed_at", { withTimezone: true }).notNull(), }, - (t) => [ - primaryKey({ columns: [t.segmentId, t.dow, t.todHour] }), - index("idx_segment_profile_segment").on(t.segmentId), - ], + (t) => [primaryKey({ name: "segment_profile_pkey", columns: [t.segmentId, t.dow, t.todHour] })], ); /** @@ -336,7 +347,13 @@ export const segmentSpeed = conditionsSchema.table( observedAt: timestamp("observed_at", { withTimezone: true }), updatedAt: timestamp("updated_at", { withTimezone: true }).notNull(), }, - (t) => [index("idx_segment_speed_los").on(t.los)], + () => [ + check("segment_speed_los_check", sql.raw(enumCheckSql("los", SEGMENT_LOS))), + check( + "segment_speed_confidence_check", + sql.raw(enumCheckSql("confidence", SEGMENT_SPEED_CONFIDENCES)), + ), + ], ); /** @@ -344,19 +361,19 @@ export const segmentSpeed = conditionsSchema.table( * its P-256 public key. Carries the Beta reliability posterior * (`reputation_alpha`/`reputation_beta`) trained only by externally resolved * outcomes, participation counters, and the entitlement window that gates - * whether the key may still submit. + * whether the key may still submit. Enrollment refreshes `last_active_at` and + * `entitlement_expires_at`; the records sweep deletes a reporter once both are + * more than twelve months old, and the delete takes the reporter's votes, + * refusals and token quotas with it and clears it from the evidence ledger. */ export const reporter = conditionsSchema.table( "reporter", { keyId: text("key_id").primaryKey(), pubJwk: jsonb("pub_jwk").notNull(), - osmUid: text("osm_uid"), - emailLookupHmac: text("email_lookup_hmac"), reputationAlpha: doublePrecision("reputation_alpha").notNull(), reputationBeta: doublePrecision("reputation_beta").notNull(), corroboratedCount: integer("corroborated_count").notNull().default(0), - flaggedCount: integer("flagged_count").notNull().default(0), trustSignal: doublePrecision("trust_signal"), entitlementExpiresAt: timestamp("entitlement_expires_at", { withTimezone: true }).notNull(), status: text("status").notNull().default("active"), @@ -364,15 +381,17 @@ export const reporter = conditionsSchema.table( lastActiveAt: timestamp("last_active_at", { withTimezone: true }).notNull(), }, (t) => [ - check("reporter_reputation_alpha_positive", sql`${t.reputationAlpha} > 0`), - check("reporter_reputation_beta_positive", sql`${t.reputationBeta} > 0`), - check("reporter_status_enum", sql`${t.status} IN ('active','blocked')`), + index("reporter_last_active_at_idx").on(t.lastActiveAt), + check("reporter_reputation_alpha_check", sql`${t.reputationAlpha} > 0`), + check("reporter_reputation_beta_check", sql`${t.reputationBeta} > 0`), + check("reporter_status_check", sql`${t.status} IN ('active','blocked')`), ], ); /** * Per-(key, epoch) count of anti-abuse tokens already issued — the rate-limit - * ledger for a reporter's submission entitlement. + * ledger for a reporter's submission entitlement. The records sweep deletes a + * row once its epoch (a UTC day) has ended. */ export const tokenQuota = conditionsSchema.table( "token_quota", @@ -381,7 +400,14 @@ export const tokenQuota = conditionsSchema.table( epoch: text("epoch").notNull(), issued: integer("issued").notNull().default(0), }, - (t) => [primaryKey({ columns: [t.keyId, t.epoch] })], + (t) => [ + primaryKey({ name: "token_quota_pkey", columns: [t.keyId, t.epoch] }), + foreignKey({ + name: "token_quota_key_id_fkey", + columns: [t.keyId], + foreignColumns: [reporter.keyId], + }).onDelete("cascade"), + ], ); /** @@ -390,8 +416,9 @@ export const tokenQuota = conditionsSchema.table( * token carries a random 32-byte nonce, so the hash is unique per token). * Redemption INSERTs here FIRST and treats a primary-key violation as * already-spent — fail closed. `purpose` records the domain-separated public - * context the token was redeemed under; `spent_at` feeds a later retention - * sweep. + * context the token was redeemed under. `expires_at` is the token's own + * expiry, the end of its issuer key's validity: no token redeems after it, so + * the records sweep deletes the row then. */ export const spentToken = conditionsSchema.table( "spent_token", @@ -399,8 +426,9 @@ export const spentToken = conditionsSchema.table( tokenHash: text("token_hash").primaryKey(), purpose: text("purpose").notNull(), spentAt: timestamp("spent_at", { withTimezone: true }).notNull(), + expiresAt: timestamp("expires_at", { withTimezone: true }).notNull(), }, - (t) => [index("idx_spent_token_spent_at").on(t.spentAt)], + (t) => [index("spent_token_expires_at_idx").on(t.expiresAt)], ); /** @@ -436,7 +464,7 @@ export const blockList = conditionsSchema.table("block_list", { * snapshot), at most one per source per ten minutes and only while a * subscription asks for them, so a peer keeps the source's unchanged readings * current (`journalSourceLiveness`). `seq` - * (bigserial) is the strictly monotonic peer cursor; entries are never + * (an identity column) is the strictly monotonic peer cursor; entries are never * updated by the application, except that an erasure scrubs the earlier * snapshots of the erased record. * @@ -452,7 +480,9 @@ export const blockList = conditionsSchema.table("block_list", { export const federationOutbox = conditionsSchema.table( "federation_outbox", { - seq: bigserial("seq", { mode: "number" }).primaryKey(), + // By default, not always: a new journal epoch copies carried entries + // back with the seq they had. + seq: bigint("seq", { mode: "number" }).primaryKey().generatedByDefaultAsIdentity(), operation: text("operation").notNull(), recordClass: text("record_class").notNull(), recordId: text("record_id").notNull(), @@ -468,23 +498,23 @@ export const federationOutbox = conditionsSchema.table( txid: xid8("txid").notNull().default(sql`pg_current_xact_id()`), }, (t) => [ - index("idx_federation_outbox_record").on(t.recordClass, t.recordId, t.seq), + index("federation_outbox_record_class_record_id_seq_idx").on(t.recordClass, t.recordId, t.seq), // The composite peer cursor's covering index: WHERE/ORDER BY are (txid, seq). - index("idx_federation_outbox_cursor").on(t.txid, t.seq), + index("federation_outbox_txid_seq_idx").on(t.txid, t.seq), // The daily retention prune deletes on `created_at < floor`; this btree // keeps that a range scan instead of a full seq-scan as the journal grows. - index("idx_federation_outbox_created_at").on(t.createdAt), + index("federation_outbox_created_at_idx").on(t.createdAt), check( - "federation_outbox_operation_enum", + "federation_outbox_operation_check", sql`${t.operation} IN ('create','update','delete','liveness')`, ), check( - "federation_outbox_record_class_enum", + "federation_outbox_record_class_check", sql.raw(enumCheckSql("record_class", RECORD_CLASSES)), ), // A change carries its record, a delete its reason and nothing else. check( - "federation_outbox_delete_shape", + "federation_outbox_delete_shape_check", sql`(${t.operation} = 'delete') = (${t.snapshot} IS NULL AND ${t.tombstoneReason} IS NOT NULL)`, ), ], @@ -516,7 +546,7 @@ export const federationJournal = conditionsSchema.table( databaseOid: bigint("database_oid", { mode: "number" }), systemIdentifier: bigint("system_identifier", { mode: "bigint" }), }, - (t) => [check("federation_journal_single_row", sql`${t.singleton}`)], + (t) => [check("federation_journal_singleton_check", sql`${t.singleton}`)], ); /** @@ -528,8 +558,9 @@ export const federationJournal = conditionsSchema.table( * still records the fact. A peer's erasure (`peer_instance_id` that peer) * refuses only that peer's deliveries, so no peer can block another's * records; this instance's own (`peer_instance_id` empty) refuses every - * peer's. `expires_at` is the 30-day retention of the deletion fact. The ROW - * is the deletion fact — never the erased content. + * peer's. `expires_at` is the 30-day retention of the deletion fact, and the + * records sweep deletes the row once it passes. The ROW is the deletion fact — + * never the erased content. */ export const federationTombstone = conditionsSchema.table( "federation_tombstone", @@ -540,7 +571,11 @@ export const federationTombstone = conditionsSchema.table( tombstonedAt: timestamp("tombstoned_at", { withTimezone: true }).notNull().defaultNow(), expiresAt: timestamp("expires_at", { withTimezone: true }).notNull(), }, - (t) => [primaryKey({ columns: [t.canonicalId, t.peerInstanceId] })], + (t) => [ + primaryKey({ name: "federation_tombstone_pkey", columns: [t.canonicalId, t.peerInstanceId] }), + index("federation_tombstone_expires_at_idx").on(t.expiresAt), + check("federation_tombstone_reason_check", sql.raw(enumCheckSql("reason", TOMBSTONE_REASONS))), + ], ); /** @@ -573,7 +608,9 @@ export const federationSourceReceipt = conditionsSchema.table( */ cadenceSec: integer("cadence_sec"), }, - (t) => [primaryKey({ columns: [t.peerInstanceId, t.sourceId] })], + (t) => [ + primaryKey({ name: "federation_source_receipt_pkey", columns: [t.peerInstanceId, t.sourceId] }), + ], ); /** @@ -595,8 +632,8 @@ export const federationLapsedCopy = conditionsSchema.table( lapsedAt: timestamp("lapsed_at", { withTimezone: true }).notNull(), }, (t) => [ - primaryKey({ columns: [t.recordClass, t.recordId] }), - index("idx_federation_lapsed_copy_source").on(t.peerInstanceId, t.sourceId), + primaryKey({ name: "federation_lapsed_copy_pkey", columns: [t.recordClass, t.recordId] }), + index("federation_lapsed_copy_peer_instance_id_source_id_idx").on(t.peerInstanceId, t.sourceId), ], ); @@ -649,8 +686,8 @@ export const onDemandFetch = conditionsSchema.table( claimedUntil: timestamp("claimed_until", { withTimezone: true }), }, (t) => [ - primaryKey({ columns: [t.sourceId, t.cell] }), - check("on_demand_fetch_status_enum", sql`${t.status} IN ('pending','fresh','failed')`), + primaryKey({ name: "on_demand_fetch_pkey", columns: [t.sourceId, t.cell] }), + check("on_demand_fetch_status_check", sql`${t.status} IN ('pending','fresh','failed')`), ], ); @@ -667,24 +704,54 @@ export const onDemandQuota = conditionsSchema.table("on_demand_quota", { dayCount: integer("day_count").notNull(), }); +/** + * One row: a fixed text sealed with the instance's secrets key, which the + * ingest service writes once. Every other service that holds the key opens + * it at start and refuses to start when it does not open, so a service given + * another key than the ingest service's never seals anything with it. + */ +export const secretsKeyCheck = conditionsSchema.table( + "secrets_key_check", + { + id: smallint("id").primaryKey().default(1), + valueCiphertext: bytea("value_ciphertext").notNull(), + valueIv: bytea("value_iv").notNull(), + valueTag: bytea("value_tag").notNull(), + createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(), + }, + (t) => [ + check("secrets_key_check_id_check", sql`${t.id} = 1`), + check("secrets_key_check_value_check", sealedSecretCheck("value")), + ], +); + /** * This instance's rotating token-issuer keypairs, each valid across a - * [not_before, not_after) window. + * [not_before, not_after) window. The private key (PKCS#8) is stored sealed + * with the instance's secrets key (AES-256-GCM, bound to the key id). */ -export const issuerKey = conditionsSchema.table("issuer_key", { - keyId: text("key_id").primaryKey(), - publicKey: bytea("public_key").notNull(), - privateKey: bytea("private_key").notNull(), - notBefore: timestamp("not_before", { withTimezone: true }).notNull(), - notAfter: timestamp("not_after", { withTimezone: true }).notNull(), -}); +export const issuerKey = conditionsSchema.table( + "issuer_key", + { + keyId: text("key_id").primaryKey(), + publicKey: bytea("public_key").notNull(), + privateKeyCiphertext: bytea("private_key_ciphertext").notNull(), + privateKeyIv: bytea("private_key_iv").notNull(), + privateKeyTag: bytea("private_key_tag").notNull(), + notBefore: timestamp("not_before", { withTimezone: true }).notNull(), + notAfter: timestamp("not_after", { withTimezone: true }).notNull(), + }, + () => [check("issuer_key_private_key_check", sealedSecretCheck("private_key"))], +); /** * This instance's rotating federation Ed25519 signing keys. `key_id` and * `multibase` are both the key's publicKeyMultibase ("z6Mk…" — served in the * Actor document and exchanged out-of-band as the bilateral pin fingerprint); * `public_key` is the raw 32-byte Ed25519 key and `private_key` its PKCS#8 - * form — an operator secret that is never served, logged, or federated. + * form — an operator secret that is never served, logged, or federated, and + * stored sealed with the instance's secrets key (AES-256-GCM, bound to the + * key id). * Rotation keeps the old and new key's [not_before, not_after) windows * overlapping (≥30 days) so peers keep verifying while the new key propagates. * Every key but the first is endorsed by the key before it: `endorsed_by` is @@ -692,18 +759,24 @@ export const issuerKey = conditionsSchema.table("issuer_key", { * Ed25519 signature that the new key is this instance's next, which a peer * that trusts the old key checks before it trusts the new. */ -export const federationInstanceKey = conditionsSchema.table("federation_instance_key", { - keyId: text("key_id").primaryKey(), - publicKey: bytea("public_key").notNull(), - privateKey: bytea("private_key").notNull(), - multibase: text("multibase").notNull(), - notBefore: timestamp("not_before", { withTimezone: true }).notNull(), - notAfter: timestamp("not_after", { withTimezone: true }).notNull(), - createdAt: timestamp("created_at", { withTimezone: true }).notNull(), - endorsedBy: text("endorsed_by"), - endorsement: bytea("endorsement"), - endorsementProof: bytea("endorsement_proof"), -}); +export const federationInstanceKey = conditionsSchema.table( + "federation_instance_key", + { + keyId: text("key_id").primaryKey(), + publicKey: bytea("public_key").notNull(), + privateKeyCiphertext: bytea("private_key_ciphertext").notNull(), + privateKeyIv: bytea("private_key_iv").notNull(), + privateKeyTag: bytea("private_key_tag").notNull(), + multibase: text("multibase").notNull(), + notBefore: timestamp("not_before", { withTimezone: true }).notNull(), + notAfter: timestamp("not_after", { withTimezone: true }).notNull(), + createdAt: timestamp("created_at", { withTimezone: true }).notNull(), + endorsedBy: text("endorsed_by"), + endorsement: bytea("endorsement"), + endorsementProof: bytea("endorsement_proof"), + }, + () => [check("federation_instance_key_private_key_check", sealedSecretCheck("private_key"))], +); /** * The keys of a pinned peer this instance trusts beyond its configured pins: @@ -721,7 +794,7 @@ export const federationPeerKey = conditionsSchema.table( anchor: text("anchor").notNull(), learnedAt: timestamp("learned_at", { withTimezone: true }).notNull(), }, - (t) => [primaryKey({ columns: [t.peerInstanceId, t.keyId] })], + (t) => [primaryKey({ name: "federation_peer_key_pkey", columns: [t.peerInstanceId, t.keyId] })], ); /** @@ -867,16 +940,17 @@ export const federationSubscription = conditionsSchema.table( .default(sql`now() + interval '30 days'`), }, (t) => [ - index("idx_federation_subscription_peer").on(t.peerId), + index("federation_subscription_peer_id_idx").on(t.peerId), // A peer holds one pull subscription and one webhook per inbox, which it // patches to what it wants; a second would push or journal twice. - uniqueIndex("uq_federation_subscription_target") + uniqueIndex("federation_subscription_target_key") .on(t.peerId, t.deliveryMode, sql`coalesce(${t.inboxUrl}, '')`) .where(sql`${t.deliveryMode} <> 'sse'`), check( - "federation_subscription_delivery_mode_enum", + "federation_subscription_delivery_mode_check", sql`${t.deliveryMode} IN ('pull','webhook','sse')`, ), + check("federation_subscription_status_check", sql`${t.status} IN ('active','push_disabled')`), ], ); @@ -892,16 +966,26 @@ export const observationRevision = conditionsSchema.table( signature: text("signature").notNull(), suppressed: boolean("suppressed").notNull(), }, - (t) => [primaryKey({ columns: [t.sourceId, t.featureId, t.property] })], + (t) => [ + primaryKey({ + name: "observation_revision_pkey", + columns: [t.sourceId, t.featureId, t.property], + }), + ], ); /** Last wholly accepted GeoNet acquisition; publication shares its transaction. */ -export const geonetCoverage = conditionsSchema.table("geonet_coverage", { - revisions: jsonb("revisions").notNull().default({}), - sourceId: text("source_id").primaryKey(), - coveredFrom: timestamp("covered_from", { withTimezone: true }).notNull(), - coveredUntil: timestamp("covered_until", { withTimezone: true }).notNull(), -}); +export const geonetCoverage = conditionsSchema.table( + "geonet_coverage", + { + revisions: jsonb("revisions").notNull().default({}), + sourceId: text("source_id").primaryKey(), + coveredFrom: timestamp("covered_from", { withTimezone: true }).notNull(), + coveredUntil: timestamp("covered_until", { withTimezone: true }).notNull(), + }, + // A coverage window ends after it starts. + (t) => [check("geonet_coverage_order_check", sql`${t.coveredFrom} < ${t.coveredUntil}`)], +); /** Durable CAP message window for SMN's rolling indexes, committed with publication. */ export const smnCapMessage = conditionsSchema.table( @@ -910,11 +994,11 @@ export const smnCapMessage = conditionsSchema.table( sourceId: text("source_id").notNull(), identifier: text("identifier").notNull(), variant: text("variant").generatedAlwaysAs(sql`encode(sha256(body), 'hex')`).notNull(), - retrieval: jsonb("retrieval").notNull().default(sql`'{"legacy":true}'::jsonb`), + retrieval: jsonb("retrieval").notNull(), body: bytea("body").notNull(), retainUntil: timestamp("retain_until", { withTimezone: true }).notNull(), }, - (t) => [primaryKey({ columns: [t.sourceId, t.variant] })], + (t) => [primaryKey({ name: "smn_cap_message_pkey", columns: [t.sourceId, t.variant] })], ); /** The bounded latest SMN projection decision, committed with originals and public records. */ @@ -938,5 +1022,5 @@ export const nswRfsClock = conditionsSchema.table( content: text("content").notNull(), expiry: text("expiry").notNull(), }, - (t) => [primaryKey({ columns: [t.sourceId, t.incidentId] })], + (t) => [primaryKey({ name: "nsw_rfs_clock_pkey", columns: [t.sourceId, t.incidentId] })], ); diff --git a/packages/core/src/db/source-schema.ts b/packages/core/src/db/source-schema.ts index 21e4dda06..0f89c05e3 100644 --- a/packages/core/src/db/source-schema.ts +++ b/packages/core/src/db/source-schema.ts @@ -1,7 +1,7 @@ import { ACCESS_MODES, enumCheckSql, SOURCE_TIERS } from "@openconditions/model"; import { sql } from "drizzle-orm"; import { boolean, check, integer, jsonb, text } from "drizzle-orm/pg-core"; -import { conditionsSchema, tstz } from "./columns.js"; +import { bytea, conditionsSchema, sealedSecretCheck, tstz } from "./columns.js"; /** * The feed catalogue as the database sees it: one row per source the ingest @@ -84,8 +84,8 @@ export const source = conditionsSchema.table( updatedAt: tstz("updated_at").notNull().defaultNow(), }, () => [ - check("source_access_mode_enum", sql.raw(enumCheckSql("access_mode", ACCESS_MODES))), - check("source_tier_enum", sql.raw(enumCheckSql("tier", SOURCE_TIERS))), + check("source_access_mode_check", sql.raw(enumCheckSql("access_mode", ACCESS_MODES))), + check("source_tier_check", sql.raw(enumCheckSql("tier", SOURCE_TIERS))), ], ); @@ -96,16 +96,29 @@ export const source = conditionsSchema.table( * configuration, so it lives here rather than in the environment, and the * ingest processes that poll its feeds refresh it under this row's lock. * `rejected_at` is set when the provider refused the refresh token; until a - * new login no request is sent with it. + * new login no request is sent with it. Both tokens are stored sealed with + * the instance's secrets key (AES-256-GCM, bound to the grant key and the + * token's column), never in clear. */ -export const oauthGrant = conditionsSchema.table("oauth_grant", { - grantKey: text("grant_key").primaryKey(), - refreshToken: text("refresh_token").notNull(), - refreshIssuedAt: tstz("refresh_issued_at").notNull(), - accessToken: text("access_token"), - accessExpiresAt: tstz("access_expires_at"), - rejectedAt: tstz("rejected_at"), - lastError: text("last_error"), - lastErrorAt: tstz("last_error_at"), - updatedAt: tstz("updated_at").notNull().defaultNow(), -}); +export const oauthGrant = conditionsSchema.table( + "oauth_grant", + { + grantKey: text("grant_key").primaryKey(), + refreshTokenCiphertext: bytea("refresh_token_ciphertext").notNull(), + refreshTokenIv: bytea("refresh_token_iv").notNull(), + refreshTokenTag: bytea("refresh_token_tag").notNull(), + refreshIssuedAt: tstz("refresh_issued_at").notNull(), + accessTokenCiphertext: bytea("access_token_ciphertext"), + accessTokenIv: bytea("access_token_iv"), + accessTokenTag: bytea("access_token_tag"), + accessExpiresAt: tstz("access_expires_at"), + rejectedAt: tstz("rejected_at"), + lastError: text("last_error"), + lastErrorAt: tstz("last_error_at"), + updatedAt: tstz("updated_at").notNull().defaultNow(), + }, + () => [ + check("oauth_grant_refresh_token_check", sealedSecretCheck("refresh_token")), + check("oauth_grant_access_token_check", sealedSecretCheck("access_token")), + ], +); diff --git a/packages/core/src/observations.ts b/packages/core/src/observations.ts index 7110c7303..4a562766a 100644 --- a/packages/core/src/observations.ts +++ b/packages/core/src/observations.ts @@ -520,9 +520,10 @@ export async function readSeries( if (series.retention_days === null || entry.retention?.latestOnly) { return { status: "no_history", property: entry.code }; } + const now = q.now ?? new Date(); const resolution = seriesResolution(entry, { from: q.from, - now: q.now ?? new Date(), + now, ...(q.resolution !== undefined ? { requested: q.resolution } : {}), }); if (resolution === undefined) return { status: "no_rollup", property: entry.code }; @@ -541,6 +542,14 @@ export async function readSeries( const to = q.to.toISOString(); if (resolution === "raw") { const [start, issued] = q.cursor === undefined ? [] : q.cursor.split("|"); + // A reading is served while it is inside the property's current raw + // retention. Each reading stays in the partition of the class it was + // written under, which drops it when that class's days are over, so after + // a retention change one may still be stored past the current window: + // it is not served. A reading of another class inside the window is. + const rawDays = entry.retention?.rawDays ?? 0; + const retainedFrom = rawDays > 0 ? now.getTime() - rawDays * DAY_MS : -Infinity; + const rawFrom = retainedFrom > q.from.getTime() ? new Date(retainedFrom).toISOString() : from; // The cursor binds as text: a client serialising a timestamptz parameter // through a Date cannot carry the `-infinity` of a reading that is no forecast. const rows = await db.execute< @@ -548,8 +557,7 @@ export async function readSeries( >( `SELECT o.*, a.payload_hashes, receipt.provenance AS captured_provenance, (SELECT min(n.phenomenon_start) FROM conditions.observation n - WHERE n.series_id = o.series_id AND n.retention_days = o.retention_days - AND n.phenomenon_start > o.phenomenon_start) + WHERE n.series_id = o.series_id AND n.phenomenon_start > o.phenomenon_start) AS superseded_at FROM conditions.observation o LEFT JOIN conditions.source_poll_attempt a ON a.id = o.fetch_id @@ -560,7 +568,7 @@ export async function readSeries( OR (o.phenomenon_start, o.issued_at) > ($4::text::timestamptz, $5::text::timestamptz)) ORDER BY o.phenomenon_start, o.issued_at LIMIT $6`, - [series.series_id, from, to, start ?? null, issued ?? null, q.limit + 1], + [series.series_id, rawFrom, to, start ?? null, issued ?? null, q.limit + 1], ); const page = rows.slice(0, q.limit); // A polled feed's change-only reading held until the next change; the diff --git a/packages/core/src/server.ts b/packages/core/src/server.ts index 2507f4f6f..bf2aa0791 100644 --- a/packages/core/src/server.ts +++ b/packages/core/src/server.ts @@ -2,8 +2,13 @@ // services' startup configuration. Kept out of the main `@openconditions/core` // barrel so consumers that only need the canonical model and read helpers — // most notably the bundled OpenMapX provider integration — don't pull -// drizzle-orm/postgres into their artifact. Services that own the schema (the -// ingest) import `runMigrations` and the table from here. Mirrors the +// drizzle-orm/postgres into their artifact. The ingest service, which owns the +// schema, imports `runMigrations` from here, and the other services +// `waitForSchemaVersion`. Mirrors the // `@openmapx/core` vs `@openmapx/core/server` split. +export * from "./credentials.js"; +export * from "./crypto/secrets.js"; +export * from "./crypto/secrets-key-check.js"; +export * from "./crypto/stored-secrets.js"; export * from "./db/index.js"; export * from "./instance.js"; diff --git a/packages/core/src/types.ts b/packages/core/src/types.ts index 44c6dac1a..c34902fff 100644 --- a/packages/core/src/types.ts +++ b/packages/core/src/types.ts @@ -47,17 +47,20 @@ export type PrivacyClass = | "crowd_pseudonym"; /** Outcome of binding an event to the directed segment spine (derived, never parser-supplied). */ -export type BindingStatus = - | "exact" - | "likely" - | "ambiguous" - | "unresolved" - | "no_coverage" - | "not_applicable" - | "obsolete"; +export const BINDING_STATUSES = [ + "exact", + "likely", + "ambiguous", + "unresolved", + "no_coverage", + "not_applicable", + "obsolete", +] as const; +export type BindingStatus = (typeof BINDING_STATUSES)[number]; /** Whether the resolver could decide the travel direction. `both` = bound in both directions of a bidirectional way. */ -export type DirectionMode = "single" | "both" | "unknown"; +export const DIRECTION_MODES = ["single", "both", "unknown"] as const; +export type DirectionMode = (typeof DIRECTION_MODES)[number]; /** One directed segment an event occupies, with the occupied fraction range along its geometry. */ export interface SegmentSpan { diff --git a/packages/federation/package.json b/packages/federation/package.json index cb14fcc91..6dabc8e0f 100644 --- a/packages/federation/package.json +++ b/packages/federation/package.json @@ -32,6 +32,7 @@ "test": "vitest run" }, "dependencies": { + "@openconditions/core": "workspace:*", "@openconditions/ingest-framework": "workspace:*", "@openconditions/model": "workspace:*", "@tufjs/canonical-json": "2.0.0", @@ -43,7 +44,6 @@ "yaml": "2.9.1" }, "devDependencies": { - "@openconditions/core": "workspace:*", "@openconditions/model-registry": "workspace:*", "@openconditions/storage": "workspace:*", "@openconditions/test-database": "workspace:*", diff --git a/packages/federation/src/__tests__/keys-db.integration.test.ts b/packages/federation/src/__tests__/keys-db.integration.test.ts index d8ffe7e3a..07f7cd85e 100644 --- a/packages/federation/src/__tests__/keys-db.integration.test.ts +++ b/packages/federation/src/__tests__/keys-db.integration.test.ts @@ -1,8 +1,16 @@ -import { createTestDatabase, type TestDatabase } from "@openconditions/test-database"; +import { SecretsKey } from "@openconditions/core/server"; +import { + createTestDatabase, + dumpHolds, + dumpTable, + TEST_SECRETS_KEY, + type TestDatabase, +} from "@openconditions/test-database"; import type postgres from "postgres"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; import { type ActorConfig, + assertInstanceKeysOpen, buildActorDocument, type InstanceKey, loadActiveKeys, @@ -15,6 +23,7 @@ import { let db: TestDatabase; let sql: postgres.Sql; +const secrets = SecretsKey.parse(TEST_SECRETS_KEY); const ME = "oc-test"; const T_BOOTSTRAP = "2026-01-01T00:00:00.000Z"; const T_QUIET = "2026-05-15T00:00:00.000Z"; @@ -55,7 +64,9 @@ describe("federation_instance_key", () => { new Set([ "key_id", "public_key", - "private_key", + "private_key_ciphertext", + "private_key_iv", + "private_key_tag", "multibase", "not_before", "not_after", @@ -70,12 +81,22 @@ describe("federation_instance_key", () => { describe("instance key lifecycle", () => { let first: InstanceKey; + let firstPkcs8: Uint8Array; let second: InstanceKey; it("creates exactly one key on first boot, unendorsed", async () => { - expect(await maintainInstanceKey(sql, T_BOOTSTRAP, ME)).toMatchObject({ status: "created" }); - expect(await maintainInstanceKey(sql, T_BOOTSTRAP, ME)).toMatchObject({ status: "current" }); - const active = await loadActiveKeys(sql, T_BOOTSTRAP); + const created = await maintainInstanceKey(sql, secrets, T_BOOTSTRAP, ME); + expect(created).toMatchObject({ status: "created" }); + firstPkcs8 = new Uint8Array( + await globalThis.crypto.subtle.exportKey( + "pkcs8", + (created as { key: InstanceKey }).key.privateKey, + ), + ); + expect(await maintainInstanceKey(sql, secrets, T_BOOTSTRAP, ME)).toMatchObject({ + status: "current", + }); + const active = await loadActiveKeys(sql, secrets, T_BOOTSTRAP); expect(active).toHaveLength(1); first = active[0]!; expect(first.keyId).toMatch(/^z6Mk/); @@ -83,6 +104,15 @@ describe("instance key lifecycle", () => { expect(first.notAfter.toISOString()).toBe("2026-07-01T00:00:00.000Z"); }, 30_000); + it("stores the private key sealed: a dump of the table does not hold it", async () => { + expect(firstPkcs8.length).toBeGreaterThan(32); + expect(dumpHolds(await dumpTable(sql, "federation_instance_key"), firstPkcs8)).toBe(false); + const [row] = await sql` + SELECT octet_length(private_key_iv) AS iv, octet_length(private_key_tag) AS tag + FROM conditions.federation_instance_key WHERE key_id = ${first.keyId}`; + expect(row).toEqual({ iv: 12, tag: 16 }); + }, 30_000); + it("a loaded key signs and verifies after the pkcs8 database round-trip", async () => { const message = new TextEncoder().encode("persisted key round-trip"); const signature = await globalThis.crypto.subtle.sign( @@ -95,15 +125,24 @@ describe("instance key lifecycle", () => { ).resolves.toBe(true); }, 30_000); + it("refuses a key that cannot open the stored private keys, naming the key id", async () => { + await expect(assertInstanceKeysOpen(sql, secrets)).resolves.toBeUndefined(); + const wrong = SecretsKey.parse("cd".repeat(32)); + await expect(assertInstanceKeysOpen(sql, wrong)).rejects.toThrow( + `wrong key: OPENCONDITIONS_SECRETS_KEY cannot decrypt conditions.federation_instance_key.private_key of the row ${first.keyId}`, + ); + await expect(loadActiveKeys(sql, wrong, T_BOOTSTRAP)).rejects.toThrow(/^wrong key: /); + }, 30_000); + it("keeps the key while more than the rotation lead is left", async () => { - expect(await maintainInstanceKey(sql, T_QUIET, ME)).toEqual({ + expect(await maintainInstanceKey(sql, secrets, T_QUIET, ME)).toEqual({ status: "current", expiresAt: first.notAfter, }); }, 30_000); it("rotates within the lead, to a key the old one endorses, keeping both valid", async () => { - const kept = await maintainInstanceKey(sql, T_ROTATE, ME); + const kept = await maintainInstanceKey(sql, secrets, T_ROTATE, ME); expect(kept.status).toBe("rotated"); second = (kept as { key: InstanceKey }).key; expect(second.notBefore.toISOString()).toBe(T_ROTATE); @@ -115,18 +154,40 @@ describe("instance key lifecycle", () => { false, ); - const active = await loadActiveKeys(sql, T_ROTATE); + const active = await loadActiveKeys(sql, secrets, T_ROTATE); expect(active.map((k) => k.keyId)).toEqual([second.keyId, first.keyId]); expect(active[0]!.endorsement).toEqual(second.endorsement); expect(active[1]!.notAfter.toISOString()).toBe("2026-07-05T00:00:00.000Z"); - expect(await maintainInstanceKey(sql, T_ROTATE, ME)).toMatchObject({ status: "current" }); + expect(await maintainInstanceKey(sql, secrets, T_ROTATE, ME)).toMatchObject({ + status: "current", + }); + }, 30_000); + + it("does not open a private key copied into another key's row", async () => { + const rollBack = new Error("roll the copy back"); + await expect( + sql.begin(async (tx) => { + await tx` + UPDATE conditions.federation_instance_key AS b SET + private_key_ciphertext = a.private_key_ciphertext, + private_key_iv = a.private_key_iv, + private_key_tag = a.private_key_tag + FROM conditions.federation_instance_key AS a + WHERE a.key_id = ${first.keyId} AND b.key_id = ${second.keyId}`; + await expect(loadActiveKeys(tx, secrets, T_ROTATE)).rejects.toThrow( + `cannot decrypt conditions.federation_instance_key.private_key of the row ${second.keyId}`, + ); + throw rollBack; + }), + ).rejects.toBe(rollBack); + expect(await loadActiveKeys(sql, secrets, T_ROTATE)).toHaveLength(2); }, 30_000); it("signs with the old key until the new one has been served a week", async () => { - expect(signingKeyOf(await loadActiveKeys(sql, T_UNPUBLISHED), T_UNPUBLISHED)?.keyId).toBe( - first.keyId, - ); - expect(signingKeyOf(await loadActiveKeys(sql, T_PUBLISHED), T_PUBLISHED)?.keyId).toBe( + expect( + signingKeyOf(await loadActiveKeys(sql, secrets, T_UNPUBLISHED), T_UNPUBLISHED)?.keyId, + ).toBe(first.keyId); + expect(signingKeyOf(await loadActiveKeys(sql, secrets, T_PUBLISHED), T_PUBLISHED)?.keyId).toBe( second.keyId, ); }, 30_000); @@ -135,7 +196,7 @@ describe("instance key lifecycle", () => { const versions = ["kernel@1.0"]; const during = buildActorDocument( ACTOR_CONFIG, - await loadActiveKeys(sql, T_PUBLISHED), + await loadActiveKeys(sql, secrets, T_PUBLISHED), versions, ); expect(during.publicKey.map((k) => k.publicKeyMultibase)).toEqual([second.keyId, first.keyId]); @@ -144,14 +205,14 @@ describe("instance key lifecycle", () => { const after = buildActorDocument( ACTOR_CONFIG, - await loadActiveKeys(sql, T_AFTER_OVERLAP), + await loadActiveKeys(sql, secrets, T_AFTER_OVERLAP), versions, ); expect(after.publicKey.map((k) => k.publicKeyMultibase)).toEqual([second.keyId]); }, 30_000); it("never shortens an old key that already outlives the overlap window", async () => { - await rotateInstanceKey(sql, "2026-07-27T00:00:00.000Z", ME); + await rotateInstanceKey(sql, secrets, "2026-07-27T00:00:00.000Z", ME); const rows = await sql<{ not_after: Date }[]>` SELECT not_after FROM conditions.federation_instance_key WHERE key_id = ${second.keyId}`; expect(rows[0]!.not_after.toISOString()).toBe("2026-12-05T00:00:00.000Z"); @@ -159,14 +220,14 @@ describe("instance key lifecycle", () => { it("rotates once every key has expired, endorsed by the last one", async () => { const t = "2028-02-01T00:00:00.000Z"; - expect(await loadActiveKeys(sql, t)).toHaveLength(0); + expect(await loadActiveKeys(sql, secrets, t)).toHaveLength(0); const [{ key_id: last }] = await sql<{ key_id: string }[]>` SELECT key_id FROM conditions.federation_instance_key ORDER BY not_before DESC LIMIT 1`; - const kept = await maintainInstanceKey(sql, t, ME); + const kept = await maintainInstanceKey(sql, secrets, t, ME); expect(kept.status).toBe("rotated"); const key = (kept as { key: InstanceKey }).key; expect(key.endorsement?.by).toBe(last); expect(await verifyEndorsement(ME, key.keyId, key.endorsement!)).toBe(true); - expect(signingKeyOf(await loadActiveKeys(sql, t), t)?.keyId).toBe(key.keyId); + expect(signingKeyOf(await loadActiveKeys(sql, secrets, t), t)?.keyId).toBe(key.keyId); }, 30_000); }); diff --git a/packages/federation/src/__tests__/outbox-db.integration.test.ts b/packages/federation/src/__tests__/outbox-db.integration.test.ts index d642e4cc5..388f20082 100644 --- a/packages/federation/src/__tests__/outbox-db.integration.test.ts +++ b/packages/federation/src/__tests__/outbox-db.integration.test.ts @@ -906,7 +906,7 @@ describe("readOutbox: the xmin fence (no permanent skip)", () => { it("holds the frontier below an in-flight transaction, then delivers with no skip", async () => { const base = await frontier(); - // A slow transaction takes the LOWER seq (bigserial is assigned at INSERT, + // A slow transaction takes the LOWER seq (an identity is assigned at INSERT, // not COMMIT) and stays open while a fast one commits a HIGHER seq. const slow = await sql.reserve(); let slowSeq: number; diff --git a/packages/federation/src/__tests__/push-db.integration.test.ts b/packages/federation/src/__tests__/push-db.integration.test.ts index ee4b6f1d7..330f4a721 100644 --- a/packages/federation/src/__tests__/push-db.integration.test.ts +++ b/packages/federation/src/__tests__/push-db.integration.test.ts @@ -1,4 +1,6 @@ +import { SecretsKey } from "@openconditions/core/server"; import { tombstoneRecords } from "@openconditions/storage"; +import { TEST_SECRETS_KEY } from "@openconditions/test-database"; import type postgres from "postgres"; import { afterAll, beforeAll, beforeEach, describe, expect, it } from "vitest"; import { InMemoryNonceStore, verifyMessage } from "../http-signature.js"; @@ -160,8 +162,9 @@ async function webhookSubFromNow(opts: { beforeAll(async () => { db = await startDatabase(); sql = db.sql; - await maintainInstanceKey(sql, NOW, "oc-test"); - [signingKey] = await loadActiveKeys(sql, NOW); + const secrets = SecretsKey.parse(TEST_SECRETS_KEY); + await maintainInstanceKey(sql, secrets, NOW, "oc-test"); + [signingKey] = await loadActiveKeys(sql, secrets, NOW); }, 120_000); afterAll(async () => { diff --git a/packages/federation/src/actor.ts b/packages/federation/src/actor.ts index cc3a45610..a274abe54 100644 --- a/packages/federation/src/actor.ts +++ b/packages/federation/src/actor.ts @@ -15,7 +15,7 @@ * its subscriptions accept. The operator configures only the protocol * versions it offers and the convergence bound it promises. */ -import type { InstanceKey, KeyEndorsement } from "./keys.js"; +import type { KeyEndorsement, PublicInstanceKey } from "./keys.js"; import { RECORD_FILTER_KEYS } from "./record-filter.js"; import { DELIVERY_MODES } from "./subscriptions.js"; @@ -135,7 +135,7 @@ function normalizeBaseUrl(baseUrl: string): string { */ export function buildActorDocument( cfg: ActorConfig, - activeKeys: InstanceKey[], + activeKeys: readonly PublicInstanceKey[], schemaVersions: readonly string[], ): ActorDocument { if (activeKeys.length === 0) { diff --git a/packages/federation/src/index.ts b/packages/federation/src/index.ts index d8a80bff5..e5bd7f993 100644 --- a/packages/federation/src/index.ts +++ b/packages/federation/src/index.ts @@ -70,14 +70,23 @@ export { readFenceHolder, readJournalLag, } from "./journal.js"; -export type { Endorser, InstanceKey, KeyEndorsement, KeyMaintenance } from "./keys.js"; +export type { + Endorser, + InstanceKey, + KeyEndorsement, + KeyMaintenance, + PublicInstanceKey, +} from "./keys.js"; export { + assertInstanceKeysOpen, endorsementMessage, generateInstanceKey, + INSTANCE_KEY_SECRETS, INSTANCE_KEY_VALIDITY_MONTHS, KEY_PUBLICATION_LEAD_DAYS, KEY_ROTATION_LEAD_DAYS, loadActiveKeys, + loadActivePublicKeys, loadSigningKey, maintainInstanceKey, ROTATION_OVERLAP_DAYS, diff --git a/packages/federation/src/keys.ts b/packages/federation/src/keys.ts index fe5d57226..07dd339d8 100644 --- a/packages/federation/src/keys.ts +++ b/packages/federation/src/keys.ts @@ -4,7 +4,8 @@ * Keys live in conditions.federation_instance_key: the raw 32-byte public key, * the private key as PKCS#8, and the publicKeyMultibase served in the Actor * document. The private key is an operator secret — persisted to the operator - * database only, never served, never logged, never federated. Unlike + * database only, sealed with the instance's secrets key, never served, never + * logged, never federated. Unlike * contrib-core's device-bound reporter keys, instance private keys are * generated extractable BY DESIGN: they must round-trip through the database * across restarts. @@ -21,9 +22,24 @@ * is endorsed by the last one all the same: no key but the first is one a * peer has no way to trust. */ +import { + assertStoredSecretsOpen, + INSTANCE_KEY_SECRETS, + type SecretPlace, + type SecretsKey, + storedSecret, +} from "@openconditions/core/server"; import type postgres from "postgres"; import { multibaseFromRawEd25519, rawEd25519FromMultibase } from "./multibase.js"; +export { INSTANCE_KEY_SECRETS }; + +const privateKeyPlace = (keyId: string): SecretPlace => ({ + table: INSTANCE_KEY_SECRETS.table, + column: "private_key", + row: keyId, +}); + /** Default instance key validity, in calendar months. */ export const INSTANCE_KEY_VALIDITY_MONTHS = 6; @@ -51,28 +67,31 @@ export interface KeyEndorsement { proof: string; } -/** A federated instance signing identity. */ -export interface InstanceKey { +/** An instance key's public half: what the actor document serves. */ +export interface PublicInstanceKey { /** Stable id — the publicKeyMultibase itself (self-describing multikey). */ keyId: string; /** Multikey/did:key form ("z6Mk…") served in the Actor document. */ publicKeyMultibase: string; /** Raw 32-byte Ed25519 public key. */ publicKeyRaw: Uint8Array; - /** Ed25519 verify handle. */ - publicKey: CryptoKey; - /** Ed25519 sign handle. NEVER served, logged, or federated. */ - privateKey: CryptoKey; notBefore: Date; notAfter: Date; /** Absent only for an instance's first key. */ endorsement?: KeyEndorsement; } -interface InstanceKeyRow { +/** A federated instance signing identity. */ +export interface InstanceKey extends PublicInstanceKey { + /** Ed25519 verify handle. */ + publicKey: CryptoKey; + /** Ed25519 sign handle. NEVER served, logged, or federated. */ + privateKey: CryptoKey; +} + +interface PublicKeyRow extends postgres.Row { key_id: string; public_key: Buffer; - private_key: Buffer; multibase: string; not_before: Date; not_after: Date; @@ -81,6 +100,12 @@ interface InstanceKeyRow { endorsement_proof: Buffer | null; } +interface InstanceKeyRow extends PublicKeyRow { + private_key_ciphertext: Buffer; + private_key_iv: Buffer; + private_key_tag: Buffer; +} + /** Calendar-month addition in UTC (JS Date end-of-month overflow semantics). */ function addMonths(base: Date, months: number): Date { const result = new Date(base.getTime()); @@ -195,20 +220,24 @@ export async function generateInstanceKey( async function insertInstanceKey( sql: postgres.Sql | postgres.TransactionSql, + secrets: SecretsKey, key: InstanceKey, createdAt: string, ): Promise { const privatePkcs8 = new Uint8Array( await globalThis.crypto.subtle.exportKey("pkcs8", key.privateKey), ); + const sealed = secrets.seal(privatePkcs8, privateKeyPlace(key.keyId)); + privatePkcs8.fill(0); const bytes = (base64url: string | undefined) => base64url === undefined ? null : Buffer.from(base64url, "base64url"); await sql` INSERT INTO conditions.federation_instance_key - (key_id, public_key, private_key, multibase, not_before, not_after, created_at, - endorsed_by, endorsement, endorsement_proof) - VALUES (${key.keyId}, ${Buffer.from(key.publicKeyRaw)}, ${Buffer.from(privatePkcs8)}, - ${key.publicKeyMultibase}, ${key.notBefore}, ${key.notAfter}, ${new Date(createdAt)}, + (key_id, public_key, private_key_ciphertext, private_key_iv, private_key_tag, multibase, + not_before, not_after, created_at, endorsed_by, endorsement, endorsement_proof) + VALUES (${key.keyId}, ${Buffer.from(key.publicKeyRaw)}, ${Buffer.from(sealed.ciphertext)}, + ${Buffer.from(sealed.iv)}, ${Buffer.from(sealed.tag)}, ${key.publicKeyMultibase}, + ${key.notBefore}, ${key.notAfter}, ${new Date(createdAt)}, ${key.endorsement?.by ?? null}, ${bytes(key.endorsement?.signature)}, ${bytes(key.endorsement?.proof)}) ON CONFLICT (key_id) DO NOTHING @@ -216,11 +245,11 @@ async function insertInstanceKey( } /** - * Rehydrates a key row's WebCrypto handles. The stored multibase is - * recomputed from the raw public key and must match — a mismatch means the - * row was tampered with or corrupted, and is refused. + * A key row's public half. The stored multibase is recomputed from the raw + * public key and must match — a mismatch means the row was tampered with or + * corrupted, and is refused. */ -async function keyOfRow(row: InstanceKeyRow): Promise { +function publicKeyOfRow(row: PublicKeyRow): PublicInstanceKey { const publicKeyRaw = new Uint8Array(row.public_key); const recomputed = multibaseFromRawEd25519(publicKeyRaw); if (recomputed !== row.multibase || row.key_id !== row.multibase) { @@ -228,26 +257,10 @@ async function keyOfRow(row: InstanceKeyRow): Promise { `federation_instance_key row ${row.key_id} is inconsistent with its public key bytes`, ); } - const publicKey = await globalThis.crypto.subtle.importKey( - "raw", - publicKeyRaw as BufferSource, - ED25519, - true, - ["verify"], - ); - const privateKey = await globalThis.crypto.subtle.importKey( - "pkcs8", - new Uint8Array(row.private_key) as BufferSource, - ED25519, - false, - ["sign"], - ); return { keyId: row.key_id, publicKeyMultibase: row.multibase, publicKeyRaw, - publicKey, - privateKey, notBefore: row.not_before, notAfter: row.not_after, ...(row.endorsed_by !== null && row.endorsement !== null && row.endorsement_proof !== null @@ -262,15 +275,67 @@ async function keyOfRow(row: InstanceKeyRow): Promise { }; } -const KEY_COLUMNS = `key_id, public_key, private_key, multibase, not_before, not_after, - endorsed_by, endorsement, endorsement_proof`; +/** + * Rehydrates a key row's WebCrypto handles, opening its private key with + * `secrets`, after {@link publicKeyOfRow}'s consistency check. + */ +async function keyOfRow(row: InstanceKeyRow, secrets: SecretsKey): Promise { + const pub = publicKeyOfRow(row); + const publicKeyRaw = pub.publicKeyRaw; + const publicKey = await globalThis.crypto.subtle.importKey( + "raw", + publicKeyRaw as BufferSource, + ED25519, + true, + ["verify"], + ); + const place = privateKeyPlace(row.key_id); + const sealed = storedSecret(row, place); + if (sealed === null) { + throw new Error(`federation_instance_key row ${row.key_id} has no private key`); + } + const pkcs8 = secrets.open(sealed, place); + const privateKey = await globalThis.crypto.subtle.importKey( + "pkcs8", + new Uint8Array(pkcs8) as BufferSource, + ED25519, + false, + ["sign"], + ); + pkcs8.fill(0); + return { ...pub, publicKey, privateKey }; +} + +const PUBLIC_KEY_COLUMNS = `key_id, public_key, multibase, not_before, not_after, endorsed_by, + endorsement, endorsement_proof`; + +const KEY_COLUMNS = `${PUBLIC_KEY_COLUMNS}, private_key_ciphertext, private_key_iv, private_key_tag`; + +/** + * The public half of every instance key valid at `now` (newest first), for + * the actor document: reads and opens no private key. + */ +export async function loadActivePublicKeys( + sql: postgres.Sql | postgres.TransactionSql, + now: string, +): Promise { + const rows = await sql.unsafe( + `SELECT ${PUBLIC_KEY_COLUMNS} FROM conditions.federation_instance_key + WHERE not_before <= $1 AND not_after > $1 + ORDER BY not_before DESC`, + [new Date(now)], + ); + return rows.map(publicKeyOfRow); +} /** - * Loads every instance key valid at `now` (newest first). During a rotation - * overlap this returns BOTH keys. + * Loads every instance key valid at `now` (newest first), opening the + * private keys with `secrets`. During a rotation overlap this returns BOTH + * keys. */ export async function loadActiveKeys( sql: postgres.Sql | postgres.TransactionSql, + secrets: SecretsKey, now: string, ): Promise { const rows = await sql.unsafe( @@ -279,16 +344,28 @@ export async function loadActiveKeys( ORDER BY not_before DESC`, [new Date(now)], ); - return Promise.all(rows.map(keyOfRow)); + return Promise.all(rows.map((row) => keyOfRow(row, secrets))); } /** The newest key ever stored, valid or not; undefined before the first. */ -async function loadLatestKey(sql: postgres.TransactionSql): Promise { +async function loadLatestKey( + sql: postgres.TransactionSql, + secrets: SecretsKey, +): Promise { const [row] = await sql.unsafe( `SELECT ${KEY_COLUMNS} FROM conditions.federation_instance_key ORDER BY not_before DESC LIMIT 1`, ); - return row === undefined ? undefined : keyOfRow(row); + return row === undefined ? undefined : keyOfRow(row, secrets); +} + +/** + * Opens every stored instance private key under `secrets`, expired ones + * too, so a key that is not the one they were sealed with stops the start + * with a "wrong key" error naming the key id. + */ +export function assertInstanceKeysOpen(sql: postgres.Sql, secrets: SecretsKey): Promise { + return assertStoredSecretsOpen(sql, secrets, INSTANCE_KEY_SECRETS); } /** @@ -304,24 +381,26 @@ export function signingKeyOf(active: readonly InstanceKey[], now: string): Insta /** The key this instance signs with now; undefined when none is valid. */ export async function loadSigningKey( sql: postgres.Sql, + secrets: SecretsKey, now: string, ): Promise { - return signingKeyOf(await loadActiveKeys(sql, now), now); + return signingKeyOf(await loadActiveKeys(sql, secrets, now), now); } async function rotateIn( tx: postgres.TransactionSql, + secrets: SecretsKey, now: string, instanceId: string, validityMonths: number, ): Promise { - const latest = await loadLatestKey(tx); + const latest = await loadLatestKey(tx, secrets); const key = await generateInstanceKey( now, validityMonths, latest === undefined ? undefined : { key: latest, instanceId }, ); - await insertInstanceKey(tx, key, now); + await insertInstanceKey(tx, secrets, key, now); const at = new Date(now); const overlapEnd = new Date(at.getTime() + ROTATION_OVERLAP_DAYS * DAY_MS); await tx` @@ -348,13 +427,14 @@ const lockKeys = (tx: postgres.TransactionSql) => */ export async function rotateInstanceKey( sql: postgres.Sql, + secrets: SecretsKey, now: string, instanceId: string, validityMonths = INSTANCE_KEY_VALIDITY_MONTHS, ): Promise { return sql.begin(async (tx) => { await lockKeys(tx); - return rotateIn(tx, now, instanceId, validityMonths); + return rotateIn(tx, secrets, now, instanceId, validityMonths); }) as Promise; } @@ -370,26 +450,27 @@ export type KeyMaintenance = */ export async function maintainInstanceKey( sql: postgres.Sql, + secrets: SecretsKey, now: string, instanceId: string, ): Promise { return sql.begin(async (tx) => { await lockKeys(tx); - const [newest] = await loadActiveKeys(tx, now); + const [newest] = await loadActiveKeys(tx, secrets, now); if ( newest !== undefined && newest.notAfter.getTime() - Date.parse(now) > KEY_ROTATION_LEAD_DAYS * DAY_MS ) { return { status: "current", expiresAt: newest.notAfter }; } - if ((await loadLatestKey(tx)) === undefined) { + if ((await loadLatestKey(tx, secrets)) === undefined) { const key = await generateInstanceKey(now); - await insertInstanceKey(tx, key, now); + await insertInstanceKey(tx, secrets, key, now); return { status: "created", key }; } return { status: "rotated", - key: await rotateIn(tx, now, instanceId, INSTANCE_KEY_VALIDITY_MONTHS), + key: await rotateIn(tx, secrets, now, instanceId, INSTANCE_KEY_VALIDITY_MONTHS), }; }) as Promise; } diff --git a/packages/federation/src/outbox.ts b/packages/federation/src/outbox.ts index 0952caf3d..a77a5f98f 100644 --- a/packages/federation/src/outbox.ts +++ b/packages/federation/src/outbox.ts @@ -16,7 +16,7 @@ * successfully (`journalSourceLiveness`); only a subscriber that asks for * them is served these, and none of a source now restricted. * - * WHY A COMPOSITE CURSOR (the gap-free ordering authority). `seq` (bigserial) + * WHY A COMPOSITE CURSOR (the gap-free ordering authority). `seq` (identity) * advances PER ROW, but `txid` (`pg_current_xact_id()`) is assigned at a * transaction's FIRST write and shared by all its rows. So an earlier-txid * multi-row write can hold HIGHER interleaved seqs than a later-txid concurrent @@ -55,7 +55,7 @@ export type OutboxOperation = "create" | "update" | "delete"; /** * The composite journal cursor. `txid` is the row's creating transaction id * (`xid8`, kept as a decimal string — it is 64-bit and monotonic but not a - * safe JS integer over a long-lived DB); `seq` is the per-row bigserial. The + * safe JS integer over a long-lived DB); `seq` is the per-row identity. The * ordering authority is `(txid, seq)` ascending. */ export interface OutboxCursor { diff --git a/packages/ingest-framework/src/catalog/credentials.ts b/packages/ingest-framework/src/catalog/credentials.ts index c30e614a2..91058a0e4 100644 --- a/packages/ingest-framework/src/catalog/credentials.ts +++ b/packages/ingest-framework/src/catalog/credentials.ts @@ -1,4 +1,4 @@ -import { readFileSync } from "node:fs"; +import { readCredential, strictCredential } from "@openconditions/core/server"; import type { CatalogFeed, CredentialField, FeedDefinition } from "./types.js"; /** Where credentials are read from: `process.env` or a test's stand-in. */ @@ -69,35 +69,7 @@ export function resolveCredential(env: Env, name: string): string | undefined { return "value" in read ? read.value : undefined; } -type CredentialRead = { value: string } | { unset: true } | { failure: string }; - -/** The env var, else the file `_FILE` names, or why that file yielded nothing. */ -function readCredential(env: Env, name: string): CredentialRead { - const direct = env[name]?.trim(); - if (direct) return { value: direct }; - const filePath = env[`${name}_FILE`]?.trim(); - if (!filePath) return { unset: true }; - let contents: string; - try { - contents = readFileSync(filePath, "utf8").trim(); - } catch (error) { - const code = (error as NodeJS.ErrnoException).code ?? String(error); - return { failure: `${name}_FILE (${filePath}) could not be read: ${code}` }; - } - return contents ? { value: contents } : { failure: `${name}_FILE (${filePath}) is empty` }; -} - -/** - * A service secret read like a credential, but strictly: undefined only when - * neither `` nor `_FILE` is set. A `_FILE` that is set but - * unreadable or empty throws naming the path and the cause, so a secret the - * operator did configure never silently counts as absent. - */ -export function strictCredential(env: Env, name: string): string | undefined { - const read = readCredential(env, name); - if ("failure" in read) throw new Error(read.failure); - return "value" in read ? read.value : undefined; -} +export { strictCredential }; /** * A secret the service cannot start without (`DATABASE_URL`), read like a diff --git a/packages/model-registry/src/__tests__/crowd-fit.test.ts b/packages/model-registry/src/__tests__/crowd-fit.test.ts index 4f488847c..a793ea1a4 100644 --- a/packages/model-registry/src/__tests__/crowd-fit.test.ts +++ b/packages/model-registry/src/__tests__/crowd-fit.test.ts @@ -45,6 +45,7 @@ const fitFormats: RegistryModule = { ], }; const registry = buildRegistry([...productionModules, fitFormats]); +const productionRegistry = buildRegistry(productionModules); const INSTANCE = "oc.example.org"; const KEY = "GlQczzclqGJy6D0X9dNq8pSYKRfkCqszpEp5g3ZGlwY"; const OTHER_KEY = "8nR0Y3oQ2kX7cS1wV5bT9uZ4aE6dF0gH2jK4lM6nP8q"; @@ -185,6 +186,18 @@ describe("what drivers report", () => { expect(life("alert", "wind")).toBeUndefined(); }); + it("keeps no history of a crowd-reported property, so no reporter key reaches it", () => { + // A crowd reading names its reporter in its provenance, and a history row + // keeps that provenance. Deleting a reporter strips its key from the + // latest readings only, so a crowd property that kept history would keep + // the key in the history partitions. + const crowd = productionRegistry.properties().filter((p) => p.crowd !== undefined); + expect(crowd.length).toBeGreaterThan(0); + for (const property of crowd) { + expect(property.retention?.latestOnly, property.code).toBe(true); + } + }); + it("refuses a transit disruption: the transit domain is not registered", () => { const landed = landClaim( registry, diff --git a/packages/probe-spike/package.json b/packages/probe-spike/package.json index f4663bd74..875bced0f 100644 --- a/packages/probe-spike/package.json +++ b/packages/probe-spike/package.json @@ -31,6 +31,7 @@ "@cloudflare/privacypass-ts": "0.9.0", "@openconditions/contrib-core": "workspace:*", "@openconditions/contributions-api": "workspace:*", + "@openconditions/core": "workspace:*", "@openconditions/test-database": "workspace:*", "@types/node": "^26.6.6", "postgres": "^3.4.9", diff --git a/packages/probe-spike/src/__tests__/tokenAdmission.integration.test.ts b/packages/probe-spike/src/__tests__/tokenAdmission.integration.test.ts index a13d44fbc..276d47b39 100644 --- a/packages/probe-spike/src/__tests__/tokenAdmission.integration.test.ts +++ b/packages/probe-spike/src/__tests__/tokenAdmission.integration.test.ts @@ -11,7 +11,12 @@ import { redemptionContext, TokenVerifier, } from "@openconditions/contributions-api/contrib"; -import { createTestDatabase, type TestDatabase } from "@openconditions/test-database"; +import { SecretsKey } from "@openconditions/core/server"; +import { + createTestDatabase, + TEST_SECRETS_KEY, + type TestDatabase, +} from "@openconditions/test-database"; import type postgres from "postgres"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; import { @@ -29,6 +34,7 @@ const { BlindRSAMode, Client, Origin, TokenResponse } = publicVerif; const NOW = "2026-07-14T08:00:00.000Z"; const GRANT_SECRET = new TextEncoder().encode("probe-spike-token-test-secret"); const noopLog = { info: () => {}, warn: () => {}, error: () => {} }; +const secrets = SecretsKey.parse(TEST_SECRETS_KEY); const REGION: RegionSpec = { regionId: "region-nl-utrecht-coarse", @@ -46,7 +52,7 @@ beforeAll(async () => { db = await createTestDatabase({ pool: { max: 10 } }); sql = db.sql; await ensureBatchSchema(sql); - await generateIssuerKey(sql, NOW); + await generateIssuerKey(sql, secrets, NOW); verifier = new TokenVerifier({ issuerName: DEFAULT_ISSUER_NAME, log: noopLog }); redeem = (tokenBytes, context, nowIso) => verifier.verify(sql, tokenBytes, context, nowIso); }, 180_000); @@ -66,7 +72,7 @@ async function enroll(): Promise { /** Full client-side Privacy Pass mint against the real issuer, bound to `ctx`. */ async function mint(keyId: string, ctx: PublicContext, cap: number): Promise { - const keys = await loadActiveIssuerKeys(sql, NOW, DEFAULT_ISSUER_NAME); + const keys = await loadActiveIssuerKeys(sql, secrets, NOW, DEFAULT_ISSUER_NAME); const issuerKey = keys[0]!; const client = new Client(BlindRSAMode.PSS); const origin = new Origin(BlindRSAMode.PSS); @@ -74,6 +80,7 @@ async function mint(keyId: string, ctx: PublicContext, cap: number): Promise { const statement = statements.find((s) => s.query.includes("feature_canonical"))!; for (const mode of ["force_custom_plan", "force_generic_plan"] as const) { const nodes = await planOf(statement, mode); - expect(nodes.some((n) => n["Index Name"] === "idx_feature_canonical_members")).toBe(true); + expect(nodes.some((n) => n["Index Name"] === "feature_canonical_member_ids_idx")).toBe(true); expect(memberScans(nodes)).toEqual([]); expect(clusterScans(nodes)).toEqual([]); } @@ -134,7 +134,7 @@ describe("clusters holding a large set of features", () => { test("go into the member index directly, so a lookup never scans a pending list", async () => { const [index] = await db.sql<{ options: string[] | null }[]>` - SELECT reloptions AS options FROM pg_class WHERE relname = 'idx_feature_canonical_members'`; + SELECT reloptions AS options FROM pg_class WHERE relname = 'feature_canonical_member_ids_idx'`; expect(index?.options).toContain("fastupdate=off"); }); }); diff --git a/packages/storage/src/__tests__/canonical-pairs.integration.test.ts b/packages/storage/src/__tests__/canonical-pairs.integration.test.ts index a6431b4e5..946d1fd53 100644 --- a/packages/storage/src/__tests__/canonical-pairs.integration.test.ts +++ b/packages/storage/src/__tests__/canonical-pairs.integration.test.ts @@ -62,7 +62,7 @@ function externalIdIntersections(plan: PlanNode): PlanNode[] { return nodesOf(plan).filter( (node) => node["Node Type"] === "BitmapAnd" && - nodesOf(node).some((descendant) => descendant["Index Name"] === "idx_feature_external_ids"), + nodesOf(node).some((descendant) => descendant["Index Name"] === "feature_external_ids_idx"), ); } @@ -71,12 +71,12 @@ describe("external-ID lookup plan guard", () => { const plan: PlanNode = { "Node Type": "Append", Plans: [ - { "Node Type": "Bitmap Index Scan", "Index Name": "idx_feature_external_ids" }, + { "Node Type": "Bitmap Index Scan", "Index Name": "feature_external_ids_idx" }, { "Node Type": "BitmapAnd", Plans: [ - { "Node Type": "Bitmap Index Scan", "Index Name": "idx_feature_kind_lifecycle" }, - { "Node Type": "Bitmap Index Scan", "Index Name": "idx_feature_source" }, + { "Node Type": "Bitmap Index Scan", "Index Name": "feature_kind_lifecycle_idx" }, + { "Node Type": "Bitmap Index Scan", "Index Name": "feature_source_id_id_idx" }, ], }, ], @@ -89,8 +89,8 @@ describe("external-ID lookup plan guard", () => { const intersection: PlanNode = { "Node Type": "BitmapAnd", Plans: [ - { "Node Type": "Bitmap Index Scan", "Index Name": "idx_feature_external_ids" }, - { "Node Type": "Bitmap Index Scan", "Index Name": "idx_feature_kind_lifecycle" }, + { "Node Type": "Bitmap Index Scan", "Index Name": "feature_external_ids_idx" }, + { "Node Type": "Bitmap Index Scan", "Index Name": "feature_kind_lifecycle_idx" }, ], }; @@ -101,21 +101,21 @@ describe("external-ID lookup plan guard", () => { const inner: PlanNode = { "Node Type": "BitmapAnd", Plans: [ - { "Node Type": "Bitmap Index Scan", "Index Name": "idx_feature_external_ids" }, - { "Node Type": "Bitmap Index Scan", "Index Name": "idx_feature_kind_lifecycle" }, + { "Node Type": "Bitmap Index Scan", "Index Name": "feature_external_ids_idx" }, + { "Node Type": "Bitmap Index Scan", "Index Name": "feature_kind_lifecycle_idx" }, ], }; const outer: PlanNode = { "Node Type": "BitmapAnd", Plans: [ { "Node Type": "BitmapOr", Plans: [inner] }, - { "Node Type": "Bitmap Index Scan", "Index Name": "idx_feature_source" }, + { "Node Type": "Bitmap Index Scan", "Index Name": "feature_source_id_id_idx" }, ], }; const plan: PlanNode = { "Node Type": "Append", Plans: [ - { "Node Type": "Bitmap Index Scan", "Index Name": "idx_feature_external_ids" }, + { "Node Type": "Bitmap Index Scan", "Index Name": "feature_external_ids_idx" }, outer, ], }; @@ -150,7 +150,7 @@ describe("the pair search of a register's poll", () => { search!.params as never, )) as { "QUERY PLAN": { Plan: PlanNode }[] }[]; const nodes = nodesOf(plans![0]!.Plan); - expect(nodes.some((n) => n["Index Name"] === "idx_feature_external_ids")).toBe(true); + expect(nodes.some((n) => n["Index Name"] === "feature_external_ids_idx")).toBe(true); expect(externalIdIntersections(plans![0]!.Plan)).toEqual([]); }, 300_000); }); diff --git a/packages/storage/src/__tests__/external-id-hot.integration.test.ts b/packages/storage/src/__tests__/external-id-hot.integration.test.ts index 04f533d87..880b274f0 100644 --- a/packages/storage/src/__tests__/external-id-hot.integration.test.ts +++ b/packages/storage/src/__tests__/external-id-hot.integration.test.ts @@ -27,7 +27,7 @@ const LATER = "2026-10-01T10:01:05.000Z"; const INSTANCE = "test.local"; const PROFILE = process.env["OC_TEST_POSTGIS_PROFILE"] ?? "pg16"; const RUN_BENCHMARK = process.env["OC_RUN_EXTERNAL_ID_BENCHMARK"] === "1"; -const GENERATED_INDEX = "idx_feature_external_ids_generated_probe"; +const GENERATED_INDEX = "feature_external_ids_idx_generated_probe"; const BENEFIT_BUDGET = { expiryMedianWalReductionAtLeast: 0.2, expiryHotRatio: "demonstrably increased", @@ -115,7 +115,7 @@ function sealed(draft: Rec, now = NOW, revision = 1): Rec { const otherIndexes = () => sql`SELECT c.relname, c.reloptions, pg_get_indexdef(c.oid) AS definition FROM pg_index i JOIN pg_class c ON c.oid=i.indexrelid WHERE i.indrelid='conditions.feature'::regclass - AND c.relname NOT IN ('idx_feature_external_ids',${GENERATED_INDEX}) ORDER BY c.relname`; + AND c.relname NOT IN ('feature_external_ids_idx',${GENERATED_INDEX}) ORDER BY c.relname`; /** DDL and index removal live only inside this disposable representation experiment. */ async function prepare(mode: Mode) { @@ -125,7 +125,7 @@ async function prepare(mode: Mode) { GENERATED ALWAYS AS (record -> 'externalIds') STORED`); await sql.unsafe(`CREATE INDEX ${GENERATED_INDEX} ON conditions.feature USING gin (external_ids jsonb_path_ops) WITH (fastupdate=off)`); - await sql.unsafe(`DROP INDEX conditions.idx_feature_external_ids`); + await sql.unsafe(`DROP INDEX conditions.feature_external_ids_idx`); } expect( (await sql`SELECT reloptions FROM pg_class WHERE oid='conditions.feature'::regclass`)[0]?.[ @@ -133,7 +133,7 @@ async function prepare(mode: Mode) { ], ).toEqual(originalReloptions); const [index] = await sql`SELECT reloptions FROM pg_class - WHERE relname=${mode === "generated" ? GENERATED_INDEX : "idx_feature_external_ids"}`; + WHERE relname=${mode === "generated" ? GENERATED_INDEX : "feature_external_ids_idx"}`; expect(index?.["reloptions"]).toContain("fastupdate=off"); expect(await otherIndexes()).toEqual(originalOtherIndexes); const columns = await columnLayout(); diff --git a/packages/storage/src/__tests__/observation-partitions.integration.test.ts b/packages/storage/src/__tests__/observation-partitions.integration.test.ts index 702419e0b..d5b5edd91 100644 --- a/packages/storage/src/__tests__/observation-partitions.integration.test.ts +++ b/packages/storage/src/__tests__/observation-partitions.integration.test.ts @@ -11,6 +11,7 @@ import type postgres from "postgres"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; import { analyzeClosedObservationPartitions, + deleteSeriesHistory, dropExpiredObservationPartitions, ensureObservationPartitions, maintainObservationPartitions, @@ -384,3 +385,27 @@ describe("partition maintenance by two services at once", () => { } }, 120_000); }); + +describe("deleting whole series", () => { + it("deletes every reading of each series, in every class, and nothing else", async () => { + await ensureObservationPartitions(sql, { classes: retentionClasses(registry), now: NOW }); + const start = NOW.toISOString(); + // 7101 changed class twice, its readings in three classes, one of them + // keep-everything; 7103's property keeps no history any more. + await sql` + INSERT INTO conditions.observation (series_id, retention_days, phenomenon_start, + fetched_at, recorded_at, temporality, aggregation, value_num) + VALUES (7101, 3, ${start}, now(), now(), 'live', 'mean', 1), + (7101, 3, ${start}::timestamptz + interval '1 minute', now(), now(), 'live', 'mean', 2), + (7101, 5, ${start}, now(), now(), 'live', 'mean', 3), + (7101, 0, ${start}, now(), now(), 'live', 'mean', 4), + (7103, 2, ${start}, now(), now(), 'live', 'mean', 5), + (7102, 3, ${start}, now(), now(), 'live', 'mean', 6)`; + expect(await deleteSeriesHistory(sql, ["7101", "7103"])).toBe(5); + expect( + await sql`SELECT series_id::int AS series, retention_days AS days + FROM conditions.observation WHERE series_id IN (7101, 7102, 7103) ORDER BY 1, 2`, + ).toEqual([{ series: 7102, days: 3 }]); + expect(await deleteSeriesHistory(sql, [])).toBe(0); + }); +}); diff --git a/packages/storage/src/__tests__/record-scope.integration.test.ts b/packages/storage/src/__tests__/record-scope.integration.test.ts index 88f21a221..159e89e61 100644 --- a/packages/storage/src/__tests__/record-scope.integration.test.ts +++ b/packages/storage/src/__tests__/record-scope.integration.test.ts @@ -445,3 +445,62 @@ describe("reader scope", () => { expect(await listed("operator")).toContain(twin["id"]); }); }); + +describe("a series' history", () => { + test("is read while inside the property's current retention, whatever class holds it", async () => { + const [series] = await sql<{ series_id: string; retention_days: number }[]>` + SELECT series_id::text AS series_id, retention_days FROM conditions.observation_latest + WHERE subject_key = ${`feature:${station["id"]}#e5`} AND property = 'fuel.price' + AND source_id = ${PUBLIC}`; + expect(series?.retention_days).not.toBeNull(); + const { series_id: id, retention_days: own } = series!; + // The property's retention has since changed to one day, as a registry + // update would change it; the history was written under other classes. + const oneDay = new Proxy(registry, { + get(target, key) { + if (key === "property") { + return (code: string) => { + const entry = target.property(code); + return code === "fuel.price" && entry ? { ...entry, retention: { rawDays: 1 } } : entry; + }; + } + const value = Reflect.get(target, key, target); + return typeof value === "function" ? value.bind(target) : value; + }, + }); + const classes = retentionClasses(registry); + const other = classes.find((days) => days !== own)!; + const longest = classes.includes(0) ? 0 : Math.max(...classes); + const reading = (days: number, start: string, price: number) => sql` + INSERT INTO conditions.observation (series_id, retention_days, phenomenon_start, + fetched_at, recorded_at, temporality, aggregation, value_money) + VALUES (${id}::bigint, ${days}, ${start}, ${NOW}, ${NOW}, 'live', 'none', ${price})`; + // Inside the day, though written under a class the series no longer has. + await reading(other, "2026-09-22T11:05:00.000Z", 1.5); + // Two days old: still stored in a longer class's partition, past the day. + await reading(longest, "2026-09-20T12:05:00.000Z", 9.5); + try { + const read = await readSeries( + runner, + oneDay, + { + scope: "operator", + subjectKey: `feature:${station["id"]}#e5`, + property: "fuel.price", + sourceId: PUBLIC, + }, + { from: new Date("2026-09-19T12:00:00.000Z"), to: new Date(LATER), now: AT, limit: 50 }, + ); + expect(read).toMatchObject({ status: "found", resolution: "raw" }); + const prices = (read as { records: Rec[] }).records.map((r) => + Number((r["result"] as { amount: string }).amount), + ); + expect(prices).toContain(1.5); + expect(prices).not.toContain(9.5); + } finally { + await sql`DELETE FROM conditions.observation + WHERE series_id = ${id}::bigint AND phenomenon_start IN + ('2026-09-22T11:05:00.000Z', '2026-09-20T12:05:00.000Z')`; + } + }); +}); diff --git a/packages/storage/src/__tests__/record-tables.integration.test.ts b/packages/storage/src/__tests__/record-tables.integration.test.ts index a5f2a5f03..392aadd50 100644 --- a/packages/storage/src/__tests__/record-tables.integration.test.ts +++ b/packages/storage/src/__tests__/record-tables.integration.test.ts @@ -62,25 +62,25 @@ describe("class tables", () => { it("reject values the kernel does not define", async () => { await expect(insertFeature("bad1", { temporality: "historic" })).rejects.toThrow( - /feature_temporality_enum/, + /feature_temporality_check/, ); await expect(insertFeature("bad2", { privacy_class: "unknown" })).rejects.toThrow( - /feature_privacy_class_enum/, + /feature_privacy_class_check/, ); await expect(insertFeature("bad3", { lifecycle: "closed" })).rejects.toThrow( - /feature_lifecycle_enum/, + /feature_lifecycle_check/, ); await expect( insertFeature("bad4", { tombstone_reason: "deleted_by_source", tombstoned_at: "2026-10-01T00:00:00Z", }), - ).rejects.toThrow(/feature_tombstone_reason_enum/); + ).rejects.toThrow(/feature_tombstone_reason_check/); }); it("require a tombstone to carry both its reason and its time", async () => { await expect(insertFeature("half", { tombstone_reason: "withdrawn" })).rejects.toThrow( - /feature_tombstone_complete/, + /feature_tombstone_check/, ); }); @@ -116,7 +116,7 @@ describe("class tables", () => { ]); await expect(sql`INSERT INTO conditions.feature_component (feature_id, key, kind, details, content_hash) VALUES ('pair-a', 'same', 'sensor_channel', '{}'::jsonb, 'duplicate')`).rejects.toThrow( - /feature_component_feature_id_key_pk/, + /feature_component_pkey/, ); } finally { await sql`DELETE FROM conditions.feature WHERE id IN ('pair-a', 'pair-b')`; @@ -127,6 +127,6 @@ describe("class tables", () => { await expect( sql`INSERT INTO conditions.feature_link (a_id, b_id, method, confidence, status, decided_at) VALUES ('b', 'a', 'manual', 1, 'accepted', now())`, - ).rejects.toThrow(/feature_link_ordered/); + ).rejects.toThrow(/feature_link_order_check/); }); }); diff --git a/packages/storage/src/__tests__/sources.integration.test.ts b/packages/storage/src/__tests__/sources.integration.test.ts index 1656892d7..0c8733a39 100644 --- a/packages/storage/src/__tests__/sources.integration.test.ts +++ b/packages/storage/src/__tests__/sources.integration.test.ts @@ -106,7 +106,7 @@ describe("syncSources", () => { it("refuses a tier the kernel does not know", async () => { await expect(syncSources(sql, [{ ...ndw, tier: "official" }])).rejects.toThrow( - /source_tier_enum/, + /source_tier_check/, ); }); diff --git a/packages/storage/src/__tests__/sweep.integration.test.ts b/packages/storage/src/__tests__/sweep.integration.test.ts index 89dad8c87..2a132e33d 100644 --- a/packages/storage/src/__tests__/sweep.integration.test.ts +++ b/packages/storage/src/__tests__/sweep.integration.test.ts @@ -4,7 +4,7 @@ import { createTestDatabase } from "@openconditions/test-database"; import postgres from "postgres"; import { afterAll, beforeAll, beforeEach, describe, expect, it } from "vitest"; import { ensureObservationPartitions, retentionClasses } from "../observation-partitions.js"; -import { type SweepOptions, sweepRecords } from "../sweep.js"; +import { REPORTER_RETENTION_MONTHS, type SweepOptions, sweepRecords } from "../sweep.js"; import { writeRecord } from "../write-record.js"; import { writeSnapshot } from "../write-records.js"; import { FETCHED_AT, firePixel, observationDraft, situationDraft } from "./drafts.js"; @@ -33,9 +33,17 @@ afterAll(async () => { beforeEach(async () => { await sql`TRUNCATE conditions.situation, conditions.observation_latest, - conditions.source_status CASCADE`; + conditions.source_status, conditions.reporter, conditions.report_evidence, + conditions.spent_token, conditions.federation_tombstone CASCADE`; }); +/** A reporter last enrolled at `at`, its entitlement ending `entitledFor` later. */ +async function reporterActive(key: string, at: string, entitledFor = "1 day") { + await sql`INSERT INTO conditions.reporter (key_id, pub_jwk, reputation_alpha, reputation_beta, + entitlement_expires_at, created_at, last_active_at) + VALUES (${key}, '{}'::jsonb, 1, 1, ${at}::timestamptz + ${entitledFor}::interval, ${at}, ${at})`; +} + /** The source polled successfully at `at`. */ async function polled(source: string, at: string) { await sql`INSERT INTO conditions.source_status (source, last_success_at, freshness_window_sec) @@ -163,6 +171,10 @@ describe("sweepRecords", () => { dropped: 0, crowdExpired: 0, transient: 0, + reporters: 0, + tokenQuotas: 0, + spentTokens: 0, + federationTombstones: 0, busy: 0, }); }); @@ -315,6 +327,7 @@ describe("sweepRecords", () => { { ...write, complete: true }, ); const id = "oc:situation:nl-ndw-events:voted"; + await reporterActive("k", LATER); await sql`INSERT INTO conditions.report_evidence (record_class, record_id, evidence_kind, actor_key_id, occurred_at) VALUES ('situation', ${id}, 'confirm', 'k', now())`; @@ -401,3 +414,155 @@ describe("sweepRecords", () => { } }); }); + +describe("sweepRecords retention", () => { + const keys = async () => + (await sql<{ key_id: string }[]>`SELECT key_id FROM conditions.reporter ORDER BY key_id`).map( + (r) => r.key_id, + ); + + it(`deletes a reporter once its activity and entitlement are both ${REPORTER_RETENTION_MONTHS} months old`, async () => { + // LATER is 2026-10-01T12:00Z, so the cutoff is 2025-10-01T12:00Z. + await reporterActive("stale", "2025-09-01T00:00:00Z"); + await reporterActive("entitled-since", "2025-09-01T00:00:00Z", "2 months"); + await reporterActive("active-since", "2026-09-01T00:00:00Z", "-20 months"); + await reporterActive("at-cutoff", "2025-10-01T12:00:00Z", "0 days"); + await reporterActive("recent", "2026-09-30T00:00:00Z"); + expect(await sweep(LATER)).toMatchObject({ reporters: 1, busy: 0 }); + expect(await keys()).toEqual(["active-since", "at-cutoff", "entitled-since", "recent"]); + }); + + it("takes a deleted reporter's votes, refusals and quotas, and keeps its evidence keyless", async () => { + await reporterActive("stale", "2025-09-01T00:00:00Z"); + await reporterActive("recent", "2026-09-30T00:00:00Z"); + for (const key of ["stale", "recent"]) { + await sql`INSERT INTO conditions.sub_claim + (id, subject_class, subject_id, claim_type, key_id, signature, created_at) + VALUES (${`s-${key}`}, 'situation', 'subj', 'confirm', ${key}, 'sig', now())`; + await sql`INSERT INTO conditions.report_refusal (actor_key_id, cell, occurred_at) + VALUES (${key}, 'cell', now())`; + await sql`INSERT INTO conditions.token_quota (key_id, epoch, issued) + VALUES (${key}, '2026-10-01', 1)`; + await sql`INSERT INTO conditions.report_evidence + (record_class, record_id, evidence_kind, actor_key_id, occurred_at) + VALUES ('situation', 'subj', 'confirm', ${key}, now())`; + } + expect(await sweep(LATER)).toMatchObject({ reporters: 1, tokenQuotas: 0 }); + expect(await sql`SELECT key_id FROM conditions.sub_claim`).toEqual([{ key_id: "recent" }]); + expect(await sql`SELECT actor_key_id FROM conditions.report_refusal`).toEqual([ + { actor_key_id: "recent" }, + ]); + expect(await sql`SELECT key_id FROM conditions.token_quota`).toEqual([{ key_id: "recent" }]); + expect( + await sql`SELECT actor_key_id FROM conditions.report_evidence + ORDER BY actor_key_id NULLS FIRST`, + ).toEqual([{ actor_key_id: null }, { actor_key_id: "recent" }]); + }); + + it("deletes the token quotas of an ended UTC day and keeps today's and other epochs", async () => { + await reporterActive("recent", "2026-09-30T00:00:00Z"); + for (const epoch of ["2026-09-29", "2026-09-30", "2026-10-01", "epoch-42"]) { + await sql`INSERT INTO conditions.token_quota (key_id, epoch, issued) + VALUES ('recent', ${epoch}, 1)`; + } + // Still 2026-09-30 in UTC-10, already 2026-10-01 in UTC: the epoch is a UTC day. + expect(await sweep("2026-09-30T20:00:00-10:00")).toMatchObject({ tokenQuotas: 2 }); + expect( + (await sql<{ epoch: string }[]>`SELECT epoch FROM conditions.token_quota ORDER BY epoch`).map( + (r) => r.epoch, + ), + ).toEqual(["2026-10-01", "epoch-42"]); + }); + + it("deletes spent tokens a day past their expiry and erasure facts past theirs", async () => { + // A day's margin: a contributions service whose clock runs behind would + // still redeem a token whose row went at its expiry. + await sql`INSERT INTO conditions.spent_token (token_hash, purpose, spent_at, expires_at) + VALUES ('gone', 'report:-:2026-09-01', '2026-09-01T00:00:00Z', '2026-09-30T11:59:59Z'), + ('kept', 'report:-:2026-09-01', '2026-09-01T00:00:00Z', '2026-09-30T12:00:00Z')`; + await sql`INSERT INTO conditions.federation_tombstone + (canonical_id, peer_instance_id, reason, tombstoned_at, expires_at) + VALUES ('gone', '', 'rights_revoked', '2026-08-01T00:00:00Z', '2026-08-31T00:00:00Z'), + ('gone', 'peer.example', 'rights_revoked', '2026-08-01T00:00:00Z', '2026-08-31T00:00:00Z'), + ('kept', '', 'rights_revoked', '2026-09-30T00:00:00Z', '2026-10-30T00:00:00Z')`; + expect(await sweep(LATER)).toMatchObject({ spentTokens: 1, federationTombstones: 2 }); + expect(await sql`SELECT token_hash FROM conditions.spent_token`).toEqual([ + { token_hash: "kept" }, + ]); + expect(await sql`SELECT canonical_id FROM conditions.federation_tombstone`).toEqual([ + { canonical_id: "kept" }, + ]); + }); + + it("deletes in batches until nothing is left", async () => { + await sql`INSERT INTO conditions.spent_token (token_hash, purpose, spent_at, expires_at) + SELECT 'expired-' || n, 'report:-:2026-09-01', '2026-09-01T00:00:00Z', + '2026-09-02T00:00:00Z' + FROM generate_series(1, 1201) n`; + expect(await sweep(LATER)).toMatchObject({ spentTokens: 1201 }); + expect(await sql`SELECT 1 FROM conditions.spent_token`).toHaveLength(0); + }); + + it("leaves a reporter another transaction holds to the next sweep", async () => { + await reporterActive("held", "2025-09-01T00:00:00Z"); + await reporterActive("stale", "2025-08-01T00:00:00Z"); + const enrolment = await sql.reserve(); + try { + await enrolment`BEGIN`; + await enrolment`SELECT 1 FROM conditions.reporter WHERE key_id = 'held' FOR UPDATE`; + expect(await sweep(LATER)).toMatchObject({ reporters: 1, busy: 0 }); + expect(await keys()).toEqual(["held"]); + } finally { + await enrolment`ROLLBACK`; + enrolment.release(); + } + expect(await sweep(LATER)).toMatchObject({ reporters: 1 }); + expect(await keys()).toEqual([]); + }); + + it("waits for a landing holding the crowd's lock before deleting reporters", async () => { + await reporterActive("stale", "2025-09-01T00:00:00Z"); + const landing = await sql.reserve(); + try { + await landing`BEGIN`; + await landing`SELECT pg_advisory_xact_lock(hashtext('crowd'))`; + const swept = sweep(LATER); + await new Promise((resolve) => setTimeout(resolve, 300)); + expect(await keys()).toEqual(["stale"]); + await landing`COMMIT`; + expect(await swept).toMatchObject({ reporters: 1, busy: 0 }); + expect(await keys()).toEqual([]); + } finally { + await landing`ROLLBACK`; + landing.release(); + } + }); + + it("leaves the reporters to the next sweep while a landing holds the crowd's lock past lock_timeout", async () => { + await reporterActive("stale", "2025-09-01T00:00:00Z"); + const maintenance = postgres(db.url, { + max: 1, + onnotice: () => {}, + connection: { lock_timeout: 200 }, + }); + const landing = await sql.reserve(); + try { + await landing`BEGIN`; + await landing`SELECT pg_advisory_xact_lock(hashtext('crowd'))`; + const busy = await sweepRecords(maintenance, { + ...write, + now: LATER, + maxAgeSec: 3600, + historyDays: 90, + }); + expect(busy).toMatchObject({ reporters: 0 }); + expect(busy.busy).toBeGreaterThanOrEqual(1); + expect(await keys()).toEqual(["stale"]); + } finally { + await landing`ROLLBACK`; + landing.release(); + await maintenance.end(); + } + expect(await sweep(LATER)).toMatchObject({ reporters: 1 }); + }); +}); diff --git a/packages/storage/src/canonical-view.ts b/packages/storage/src/canonical-view.ts index 8aea55478..d52a07df1 100644 --- a/packages/storage/src/canonical-view.ts +++ b/packages/storage/src/canonical-view.ts @@ -31,6 +31,7 @@ import { lockKeys, refreshFused, } from "./fused-rows.js"; +import { deleteSeriesHistory } from "./observation-partitions.js"; import { pause, RECORDS_PER_TURN } from "./pause.js"; import { seriesRowOf } from "./write-observations.js"; @@ -523,9 +524,10 @@ export async function rekeyCrowdSeries( } if (drop.length > 0) { const records = await tx<{ id: string }[]>` - DELETE FROM conditions.observation_latest WHERE series_id = ANY(${drop}::bigint[]) + DELETE FROM conditions.observation_latest + WHERE series_id = ANY(${drop}::bigint[]) RETURNING crowd_record_id AS id`; - await tx`DELETE FROM conditions.observation WHERE series_id = ANY(${drop}::bigint[])`; + await deleteSeriesHistory(tx, drop); const ids = records.map((r) => r.id); await tx` DELETE FROM conditions.report_evidence diff --git a/packages/storage/src/observation-partitions.ts b/packages/storage/src/observation-partitions.ts index 874f12972..45ceb366f 100644 --- a/packages/storage/src/observation-partitions.ts +++ b/packages/storage/src/observation-partitions.ts @@ -14,6 +14,24 @@ export function retentionDaysOf(entry: Pick): number return entry.retention?.rawDays ?? 0; } +/** + * Deletes every reading of whole series that are gone, in every retention + * class: a reading stays in the class it was written under, so a series + * whose class changed, or whose property keeps no history any more, may hold + * readings in several, and those of the keep-everything class would never be + * dropped. The primary key leads with the series, so each partition is one + * index probe. Returns the rows deleted. + */ +export async function deleteSeriesHistory( + sql: postgres.Sql | postgres.TransactionSql, + seriesIds: readonly string[], +): Promise { + if (seriesIds.length === 0) return 0; + const result = await sql` + DELETE FROM conditions.observation WHERE series_id = ANY(${seriesIds}::bigint[])`; + return result.count; +} + /** Every retention class the registry's properties use, ascending. */ export function retentionClasses(registry: Registry): number[] { const classes = new Set(); diff --git a/packages/storage/src/sweep.ts b/packages/storage/src/sweep.ts index a8393993b..48c7bc4e8 100644 --- a/packages/storage/src/sweep.ts +++ b/packages/storage/src/sweep.ts @@ -46,10 +46,38 @@ export interface SweepCounts { crowdExpired: number; /** Series of transient properties deleted once their reading expired. */ transient: number; - /** Passes over a source left to the next sweep: its lock was held past `lock_timeout`. */ + /** Crowd reporters deleted after {@link REPORTER_RETENTION_MONTHS} without activity. */ + reporters: number; + /** Token quota rows of an epoch that has ended. */ + tokenQuotas: number; + /** Spent-token rows a day past the token's own expiry. */ + spentTokens: number; + /** Federation erasure facts past their retention. */ + federationTombstones: number; + /** + * Passes over a source, or retention batches, left to the next sweep: a + * lock was held past `lock_timeout`. + */ busy: number; } +/** + * How long a crowd reporter is kept once both its last enrollment and its + * entitlement lie behind it: a reporter that has not enrolled for this long + * is deleted, and enrolling again starts a new reporter. + */ +export const REPORTER_RETENTION_MONTHS = 12; + +/** + * Rows one retention delete takes. Each batch is its own statement and + * transaction, so a sweep holds its row locks only for one batch, and a + * reporter's cascade touches its own votes, refusals, quotas and evidence. + */ +const RETENTION_BATCH = 500; + +/** How long a spent token is kept past its expiry, for clocks that disagree. */ +const SPENT_TOKEN_MARGIN = "1 day"; + const CLASSES: readonly RevisionedClass[] = ["situation", "feature", "offer"]; /** A live, bulk record whose own expiry has passed. ($1 = now) */ @@ -93,11 +121,17 @@ const ORPHANED = `r.tombstoned_at IS NULL AND r.instance_id = $2 AND r.origin IN * partition is dropped; * - a crowd reading whose report's lifetime ended is marked `expired`, and * the fused rows it fed are recomputed without it. Its series row stays: - * it is what the reading's history is read back through. + * it is what the reading's history is read back through; + * - crowd and federation bookkeeping past its retention is deleted (see + * {@link sweepRetention}): inactive reporters with what they left, + * token quotas of ended epochs, spent tokens past their expiry and + * expired erasure facts. * A feature that ends or goes leaves the canonical view with it. A declared validity end is never a reason: a source that still publishes * an ended record keeps it, and reads filter by time. Every tombstone and - * delete is chosen and written under its source's advisory lock, like any - * other write, so a poll or a confirmation in between is never undone. + * delete of a record is chosen and written under its source's advisory lock, + * like any other write, so a poll or a confirmation in between is never + * undone; the crowd and federation bookkeeping uses row locks instead (see + * {@link sweepRetention}). */ export async function sweepRecords(sql: postgres.Sql, opts: SweepOptions): Promise { const counts: SweepCounts = { @@ -108,6 +142,10 @@ export async function sweepRecords(sql: postgres.Sql, opts: SweepOptions): Promi dropped: 0, crowdExpired: 0, transient: 0, + reporters: 0, + tokenQuotas: 0, + spentTokens: 0, + federationTombstones: 0, busy: 0, }; const busy = () => counts.busy++; @@ -218,9 +256,147 @@ export async function sweepRecords(sql: postgres.Sql, opts: SweepOptions): Promi if (!isLockTimeout(err)) throw err; busy(); } + Object.assign(counts, await sweepRetention(sql, opts.now, busy)); return counts; } +/** + * Deletes crowd and federation bookkeeping past its retention: + * - a reporter whose `last_active_at` and `entitlement_expires_at` both lie + * more than {@link REPORTER_RETENTION_MONTHS} before `now`. Both columns + * are NOT NULL, so neither stands for "unknown"; the delete strips the + * reporter's key from what it reported (its trigger), takes its votes, + * refusals and token quotas with it and clears its key from the evidence + * it gave (the foreign keys' actions). Its block-list entry stays, so the + * key enrolls blocked again; + * - a token quota row whose epoch, a UTC day, has ended. An epoch of + * another form is left alone; it goes with its reporter; + * - a spent-token row a day past `expires_at`, its token's own expiry: the + * day covers a contributions service whose clock runs behind this one, + * which would still redeem the token until its own clock passes the + * expiry; + * - a federation erasure fact past `expires_at`. + * Each runs in batches of {@link RETENTION_BATCH} rows, skipping rows another + * transaction holds (the next sweep takes them); a batch that meets a lock + * held past `lock_timeout` is left to the next sweep and counted by `busy`. + */ +async function sweepRetention( + sql: postgres.Sql, + now: string, + busy: () => void, +): Promise< + Pick +> { + const federationTombstones = await deleteInBatches( + sql, + busy, + "federation_tombstone", + ["canonical_id", "peer_instance_id"], + `expires_at < $1`, + [now], + ); + const spentTokens = await deleteInBatches( + sql, + busy, + "spent_token", + ["token_hash"], + `expires_at < $1::timestamptz - interval '${SPENT_TOKEN_MARGIN}'`, + [now], + ); + const tokenQuotas = await deleteInBatches( + sql, + busy, + "token_quota", + ["key_id", "epoch"], + `epoch ~ '^[0-9]{4}-[0-9]{2}-[0-9]{2}$' + AND epoch COLLATE "C" < to_char($1::timestamptz AT TIME ZONE 'UTC', 'YYYY-MM-DD')`, + [now], + ); + const reporters = await deleteInactiveReporters(sql, busy, now); + return { reporters, tokenQuotas, spentTokens, federationTombstones }; +} + +/** + * Deletes the reporters inactive past {@link REPORTER_RETENTION_MONTHS}, + * {@link RETENTION_BATCH} per transaction. Each takes the crowd's lock first, + * then the reporter rows it can lock without waiting, then deletes them: the + * order every landing takes them in (the crowd's lock, then the reporter row + * its evidence references), so the two never deadlock, and a landing holding + * the lock is never interleaved with the delete. The delete's trigger strips + * the reporters' keys from what they reported, and its foreign keys take + * their votes, refusals and quotas. + */ +async function deleteInactiveReporters( + sql: postgres.Sql, + busy: () => void, + now: string, +): Promise { + let n = 0; + for (;;) { + let taken: number; + try { + taken = (await sql.begin(async (tx) => { + await tx`SELECT pg_advisory_xact_lock(hashtext('crowd'))`; + const keys = ( + await tx<{ key_id: string }[]>` + SELECT key_id FROM conditions.reporter + WHERE last_active_at < ${now}::timestamptz + - make_interval(months => ${REPORTER_RETENTION_MONTHS}) + AND entitlement_expires_at < ${now}::timestamptz + - make_interval(months => ${REPORTER_RETENTION_MONTHS}) + LIMIT ${RETENTION_BATCH} FOR UPDATE SKIP LOCKED` + ).map((r) => r.key_id); + if (keys.length === 0) return 0; + return (await tx`DELETE FROM conditions.reporter WHERE key_id = ANY(${keys})`).count; + })) as number; + } catch (err) { + if (!isLockTimeout(err)) throw err; + busy(); + break; + } + n += taken; + if (taken < RETENTION_BATCH) return n; + } + return n; +} + +/** + * Deletes the rows of `table` matching `where`, {@link RETENTION_BATCH} per + * statement, until a batch comes back short. Rows locked by another + * transaction are skipped rather than waited for. Returns how many it deleted. + */ +async function deleteInBatches( + sql: postgres.Sql, + busy: () => void, + table: string, + key: readonly string[], + where: string, + params: readonly (string | number)[], +): Promise { + const cols = key.join(", "); + let n = 0; + for (;;) { + let taken: number; + try { + const rows = await sql.unsafe( + `DELETE FROM conditions.${table} WHERE (${cols}) IN ( + SELECT ${cols} FROM conditions.${table} WHERE ${where} + LIMIT ${RETENTION_BATCH} FOR UPDATE SKIP LOCKED) + RETURNING 1`, + [...params], + ); + taken = rows.length; + } catch (err) { + if (!isLockTimeout(err)) throw err; + busy(); + break; + } + n += taken; + if (taken < RETENTION_BATCH) return n; + } + return n; +} + /** * Marks the crowd readings whose report's lifetime has passed `expired`, * under the crowd's lock, and recomputes the fused rows they fed. A negated diff --git a/packages/test-database/src/index.ts b/packages/test-database/src/index.ts index 648ab51b5..3a093ceed 100644 --- a/packages/test-database/src/index.ts +++ b/packages/test-database/src/index.ts @@ -46,6 +46,98 @@ export interface TestDatabaseOptions { empty?: boolean; } +/** A login role on the shared server, as a service's own database role. */ +export interface TestRole { + name: string; + /** The test database's URL, logging in as this role. */ + url: string; + /** Drops the role; close every database it holds objects or grants in first. */ + drop(): Promise; +} + +/** + * A login role with no privileges beyond PUBLIC's, for testing what a + * service's own role may do in `database`. Roles belong to the whole server, + * so each gets a unique name. + */ +export async function createTestRole(database: TestDatabase): Promise { + const shared = inject("postgis"); + if (!shared) throw new Error("No shared PostGIS server: run the integration Vitest project"); + const name = `r_${randomUUID().replaceAll("-", "")}`; + const password = randomUUID().replaceAll("-", ""); + await administer(shared.adminUrl, (admin) => + admin.unsafe(`CREATE ROLE "${name}" LOGIN PASSWORD '${password}'`), + ); + const url = new URL(database.url); + url.username = name; + url.password = password; + return { + name, + url: url.toString(), + async drop() { + await administer(shared.adminUrl, (admin) => admin.unsafe(`DROP ROLE IF EXISTS "${name}"`)); + }, + }; +} + +/** + * A secrets key (`OPENCONDITIONS_SECRETS_KEY`) for the services' test + * environments: 64 hexadecimal characters, as an operator generates with + * `openssl rand -hex 32`. It seals only throwaway test data. + */ +export const TEST_SECRETS_KEY = "5ec7e75ec7e75ec7e75ec7e75ec7e75ec7e75ec7e75ec7e75ec7e75ec7e75ec7"; + +/** + * The rows of `conditions.
` as `pg_dump` writes them: the text output + * of `COPY … TO STDOUT`, bytea columns in hex. A test searches it for a + * secret, in clear and as hex, to show a backup does not hold it. + */ +export async function dumpTable(sql: postgres.Sql, table: string): Promise { + const chunks: Buffer[] = []; + const stream = await sql.unsafe(`COPY "conditions"."${table}" TO STDOUT`).readable(); + for await (const chunk of stream) chunks.push(Buffer.from(chunk as Uint8Array)); + return Buffer.concat(chunks).toString("utf8"); +} + +/** Whether `dump` holds `secret`, in clear or as the hex `pg_dump` writes bytea in. */ +export function dumpHolds(dump: string, secret: Uint8Array | string): boolean { + const bytes = typeof secret === "string" ? Buffer.from(secret, "utf8") : Buffer.from(secret); + return dump.includes(bytes.toString("utf8")) || dump.includes(bytes.toString("hex")); +} + +/** + * The roles the custom migration grants to by name: the one OpenMapX's + * traffic tile function runs as, which cannot log in, and the contributions + * service's login. + */ +export const TILES_OWNER_ROLE = "openmapx_tiles_owner"; +export const CONTRIBUTIONS_ROLE = "openconditions_contributions"; +/** The contributions role's password on the throwaway test server. */ +const CONTRIBUTIONS_PASSWORD = "contributions"; + +/** + * Creates the roles the custom migration grants to, as an operator creates + * them. The global setup calls it once, after migrating the template, so a + * clone of the template holds no grants to them; a suite that tests the + * grants migrates an empty database. + */ +export async function createGranteeRoles(adminUrl: string): Promise { + await administer(adminUrl, (admin) => + admin.unsafe(` + CREATE ROLE ${TILES_OWNER_ROLE} NOLOGIN NOINHERIT; + CREATE ROLE ${CONTRIBUTIONS_ROLE} LOGIN PASSWORD '${CONTRIBUTIONS_PASSWORD}'; + `), + ); +} + +/** `database`'s URL, logging in as the contributions service's role. */ +export function contributionsRoleUrl(database: TestDatabase): string { + const url = new URL(database.url); + url.username = CONTRIBUTIONS_ROLE; + url.password = CONTRIBUTIONS_PASSWORD; + return url.toString(); +} + async function administer(adminUrl: string, run: (admin: postgres.Sql) => Promise) { const admin = postgres(adminUrl, { max: 1, onnotice: () => {} }); try { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2ef029edb..52cbeaec8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -488,6 +488,9 @@ importers: packages/federation: dependencies: + '@openconditions/core': + specifier: workspace:* + version: link:../core '@openconditions/ingest-framework': specifier: workspace:* version: link:../ingest-framework @@ -516,9 +519,6 @@ importers: specifier: 2.9.1 version: 2.9.1 devDependencies: - '@openconditions/core': - specifier: workspace:* - version: link:../core '@openconditions/model-registry': specifier: workspace:* version: link:../model-registry @@ -1039,6 +1039,9 @@ importers: '@openconditions/contributions-api': specifier: workspace:* version: link:../../services/contributions-api + '@openconditions/core': + specifier: workspace:* + version: link:../core '@openconditions/test-database': specifier: workspace:* version: link:../test-database @@ -2488,10 +2491,6 @@ packages: resolution: {integrity: sha512-yVtV8zsdo8qFHe+/3kw81dSLyF7D576A5cCFCi4X7B39tWT7SekaEFUnvnWJHz+9qO7qJTah1JbrDjWKqFtdWA==} engines: {node: ^16.14.0 || >=18.0.0} - '@tufjs/models@5.0.2': - resolution: {integrity: sha512-YzKuFwBcH+m4/YIN0magcH5AjgYVnNFUGhP14vCs+Ckanqz86dDn6K0anjjb730Iu6SSqjzXQCo3FzVqYyT+wg==} - engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} - '@tufjs/models@5.0.3': resolution: {integrity: sha512-rNNqM2QoZoGLhUxMp0RK4fIFRhQz9viRHph6N3qA4+Hpa8linMhZv0VdQ+tDaNRzbWPiE2YAikU0orDk2X4DvA==} engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} @@ -4983,11 +4982,6 @@ snapshots: '@tufjs/canonical-json@2.0.0': {} - '@tufjs/models@5.0.2': - dependencies: - '@tufjs/canonical-json': 2.0.0 - minimatch: 11.0.3 - '@tufjs/models@5.0.3': dependencies: '@tufjs/canonical-json': 2.0.0 diff --git a/scripts/__tests__/check-drizzle-drift.test.ts b/scripts/__tests__/check-drizzle-drift.test.ts new file mode 100644 index 000000000..b20ff78ae --- /dev/null +++ b/scripts/__tests__/check-drizzle-drift.test.ts @@ -0,0 +1,102 @@ +import { describe, expect, it } from "vitest"; +import { type DriftSteps, driftProblems } from "../check-drizzle-drift.js"; + +// Output shapes as drizzle-kit 0.31 prints them. +const config = + "No config path provided, using default 'drizzle.config.ts'\nReading config file '/repo/packages/core/drizzle.config.ts'\n"; +const fine = { status: 0, output: `${config}Everything's fine 🐶🔥\n` }; +const tables = "source 34 columns 0 indexes 0 fks\n"; +const clean: DriftSteps = { + check: fine, + generate: { status: 0, output: `${config}${tables}\nNo schema changes, nothing to migrate 😴\n` }, + status: { status: 0, output: "" }, +}; + +describe("driftProblems", () => { + it("accepts migrations that match the schema code", () => { + expect(driftProblems(clean)).toEqual([]); + }); + + it("refuses a rename prompt drizzle-kit declined without a TTY, although it exited 0", () => { + const problems = driftProblems({ + ...clean, + generate: { + status: 0, + output: `${config}${tables}Error: Interactive prompts require a TTY terminal (process.stdin.isTTY or process.stdout.isTTY is false). This can happen when running in CI, piped input, or non-interactive shells.\n at render10 (bin.cjs:1450:31)\n`, + }, + }); + expect(problems.some((p) => p.includes("Interactive prompts require a TTY"))).toBe(true); + expect(problems.some((p) => p.includes("No schema changes, nothing to migrate"))).toBe(true); + }); + + it("refuses a new migration file", () => { + const problems = driftProblems({ + ...clean, + generate: { + status: 0, + output: `${config}${tables}[✓] Your SQL migration file ➜ drizzle/0002_famous_domino.sql 🚀\n`, + }, + status: { + status: 0, + output: + " M packages/core/drizzle/meta/_journal.json\n?? packages/core/drizzle/0002_famous_domino.sql\n?? packages/core/drizzle/meta/0002_snapshot.json\n", + }, + }); + expect(problems).toHaveLength(2); + expect(problems[1]).toContain("?? packages/core/drizzle/0002_famous_domino.sql"); + }); + + it("refuses schema code that fails to load, although drizzle-kit exited 0", () => { + const problems = driftProblems({ + ...clean, + generate: { + status: 0, + output: `${config}Error: Cannot find module './does-not-exist.js'\nRequire stack:\n- /repo/packages/core/src/db/schema.ts\n`, + }, + }); + expect(problems.some((p) => p.includes("Cannot find module"))).toBe(true); + }); + + it("refuses uncommitted changes in the migrations folder", () => { + expect( + driftProblems({ + ...clean, + status: { status: 0, output: " M packages/core/drizzle/0001_database_objects.sql\n" }, + }), + ).toEqual([ + "packages/core/drizzle differs from what Git holds:\n M packages/core/drizzle/0001_database_objects.sql", + ]); + }); + + it("refuses a failing git status even without output", () => { + expect( + driftProblems({ + ...clean, + status: { status: 128, output: "" }, + }), + ).toEqual(["git status --porcelain -- packages/core/drizzle exited with 128"]); + }); + + it("refuses a drizzle-kit run that timed out or was not found", () => { + const problems = driftProblems({ + ...clean, + check: { status: null, error: "spawnSync pnpm ETIMEDOUT", output: "" }, + }); + expect(problems).toEqual([ + "drizzle-kit check did not run: spawnSync pnpm ETIMEDOUT", + 'drizzle-kit check did not report "Everything\'s fine"', + ]); + }); + + it("refuses a nonzero exit and a check that did not confirm the snapshots", () => { + const problems = driftProblems({ + ...clean, + check: { status: 1, output: `${config}Error: snapshot collision\n` }, + }); + expect(problems).toEqual([ + "drizzle-kit check exited with 1", + "drizzle-kit check reported: Error: snapshot collision", + 'drizzle-kit check did not report "Everything\'s fine"', + ]); + }); +}); diff --git a/scripts/__tests__/gen-credentials-lib.test.ts b/scripts/__tests__/gen-credentials-lib.test.ts index 7b752037c..cfc64ad8e 100644 --- a/scripts/__tests__/gen-credentials-lib.test.ts +++ b/scripts/__tests__/gen-credentials-lib.test.ts @@ -120,7 +120,11 @@ describe("gen-credentials-lib", () => { it("emits the service's own secrets as vault fields without a default", () => { const props = configSchemaPropertiesFor(ofFeeds([])); - for (const key of ["DATABASE_URL", "OPENCONDITIONS_OPERATOR_TOKEN"]) { + for (const key of [ + "DATABASE_URL", + "OPENCONDITIONS_SECRETS_KEY", + "OPENCONDITIONS_OPERATOR_TOKEN", + ]) { expect(props[key]).toMatchObject({ type: "string", "x-openmapx-secret": true }); expect(props[key]).not.toHaveProperty("default"); } diff --git a/scripts/__tests__/service-manifests.test.ts b/scripts/__tests__/service-manifests.test.ts index 2d9573546..522212b01 100644 --- a/scripts/__tests__/service-manifests.test.ts +++ b/scripts/__tests__/service-manifests.test.ts @@ -3,6 +3,7 @@ import { describe, expect, test } from "vitest"; interface Property { default?: unknown; + description?: string; "x-openmapx-secret"?: boolean; } @@ -169,12 +170,25 @@ describe("service manifests on OpenMapX's config model", () => { for (const key of secrets(m)) expect(properties(m)[key]?.default, key).toBeUndefined(); }); - test("ingest: the database URL and the operator token are vault secrets", () => { + test("ingest: the database URL, the secrets key and the operator token are vault secrets", () => { expect(secrets(manifest("ingest"))).toEqual( - expect.arrayContaining(["DATABASE_URL", "OPENCONDITIONS_OPERATOR_TOKEN"]), + expect.arrayContaining([ + "DATABASE_URL", + "OPENCONDITIONS_SECRETS_KEY", + "OPENCONDITIONS_OPERATOR_TOKEN", + ]), ); }); + test.each(["ingest", "contributions-api", "federation"])( + "%s: the secrets key that encrypts its stored secrets is a vault secret", + (dir) => { + expect(properties(manifest(dir))["OPENCONDITIONS_SECRETS_KEY"]).toMatchObject({ + "x-openmapx-secret": true, + }); + }, + ); + /** * What a shared package reads on a path the service never takes. The * contributions API fetches nothing through the egress guard or the @@ -280,7 +294,16 @@ describe("service manifests on OpenMapX's config model", () => { service: "openconditions-ingest", condition: "service_healthy", }); - expect(m.configSchema).toEqual(ingest.configSchema); + // The same fields, but the secrets key is copied from the ingest service, never generated. + const { OPENCONDITIONS_SECRETS_KEY: heavyKey, ...heavyRest } = properties(m); + const { OPENCONDITIONS_SECRETS_KEY: ingestKey, ...ingestRest } = properties(ingest); + expect(heavyRest).toEqual(ingestRest); + expect({ ...heavyKey, description: undefined }).toEqual({ + ...ingestKey, + description: undefined, + }); + expect(heavyKey?.description).toMatch(/^Required\. Copy the value of openconditions-ingest's/); + expect(heavyKey?.description).not.toContain("openssl rand"); expect( defaults(m, ["OPENCONDITIONS_INGEST_FEEDS", "OPENCONDITIONS_INGEST_FEEDS_EXCLUDE"]), ).toEqual({ OPENCONDITIONS_INGEST_FEEDS: "", OPENCONDITIONS_INGEST_FEEDS_EXCLUDE: "" }); @@ -316,16 +339,18 @@ describe("service manifests on OpenMapX's config model", () => { } }); - test("contributions-api: its database URL, grant secret and reviewer token are vault secrets", () => { + test("contributions-api: its database URL, secrets key, grant secret and reviewer token are vault secrets", () => { const m = manifest("contributions-api"); expect(m.container.environment).toEqual({ PORT: "4200", HOST: "0.0.0.0" }); expect(secrets(m).sort()).toEqual([ "DATABASE_URL", "OPENCONDITIONS_GRANT_SECRET", "OPENCONDITIONS_REVIEWER_TOKEN", + "OPENCONDITIONS_SECRETS_KEY", ]); const expected = { OPENCONDITIONS_INSTANCE_ID: "", + OPENCONDITIONS_SCHEMA_WAIT_TIMEOUT_MS: "", OPENCONDITIONS_ISSUER_NAME: "", OPENCONDITIONS_CROSS_VALIDATE_SWEEP: "", OPENCONDITIONS_CROWD_LICENSE: "", @@ -335,7 +360,7 @@ describe("service manifests on OpenMapX's config model", () => { expect(defaults(m, Object.keys(expected))).toEqual(expected); }); - test("federation: off by default, its database URL and client certificate key the only secrets", () => { + test("federation: off by default, its database URL, secrets key and client certificate key the only secrets", () => { const m = manifest("federation"); // Its registry cache and a peer's archive files while they land live on its volume. expect(m.container.environment).toEqual({ @@ -344,8 +369,13 @@ describe("service manifests on OpenMapX's config model", () => { OPENCONDITIONS_FEDERATION_REGISTRY_CACHE: "/data/registry", TMPDIR: "/data", }); - expect(secrets(m)).toEqual(["DATABASE_URL", "OPENCONDITIONS_FEDERATION_CLIENT_KEY"]); + expect(secrets(m)).toEqual([ + "DATABASE_URL", + "OPENCONDITIONS_SECRETS_KEY", + "OPENCONDITIONS_FEDERATION_CLIENT_KEY", + ]); expect(properties(m)["OPENCONDITIONS_FEDERATION_ENABLED"]?.default).toBe(""); + expect(properties(m)["OPENCONDITIONS_SCHEMA_WAIT_TIMEOUT_MS"]?.default).toBe(""); }); test("federation: not in the extension, which would start it on every install unreachable", () => { diff --git a/scripts/check-docker-contexts.mjs b/scripts/check-docker-contexts.mjs index 21a40782c..7ef49a0e8 100644 --- a/scripts/check-docker-contexts.mjs +++ b/scripts/check-docker-contexts.mjs @@ -157,7 +157,7 @@ function producer(root) { // A changed Python producer needs a fresh review of these context/recipe facts. if ( sha256(regular(join(root, "scripts/qualify-container-images.py")).bytes) !== - "f073a2b9c6571dd086d6444bc7c8c499293606331b3572c006419399377f4348" || + "b70bff6295c2bc190139b89e5b78279b07c1d3fac4d8ff709c6bcacb35eebfd8" || JSON.stringify(job?.strategy?.matrix) !== JSON.stringify({ image: images.map((i) => i.image) }) || step?.length !== 1 || diff --git a/scripts/check-drizzle-drift.ts b/scripts/check-drizzle-drift.ts new file mode 100644 index 000000000..39d72cdb1 --- /dev/null +++ b/scripts/check-drizzle-drift.ts @@ -0,0 +1,84 @@ +import { spawnSync } from "node:child_process"; +import { fileURLToPath } from "node:url"; + +/** What one command of the gate did: its exit, any failure to run it, and its combined output. */ +export interface StepResult { + status: number | null; + error?: string; + output: string; +} + +export interface DriftSteps { + check: StepResult; + generate: StepResult; + status: StepResult; +} + +const MIGRATIONS = "packages/core/drizzle"; +const TIMEOUT_MS = 120_000; + +/** + * Why the migrations do not match the schema code, or nothing when they do. + * drizzle-kit exits 0 when it refuses a prompt (it has no TTY in CI) and when + * the schema code fails to load, writing nothing either way, so its exit code + * and an unchanged folder alone prove nothing: it must also say so. + */ +export function driftProblems(steps: DriftSteps): string[] { + const problems: string[] = []; + const named = [ + ["drizzle-kit check", steps.check], + ["drizzle-kit generate", steps.generate], + [`git status --porcelain -- ${MIGRATIONS}`, steps.status], + ] as const; + for (const [name, step] of named) { + if (step.error) problems.push(`${name} did not run: ${step.error}`); + else if (step.status !== 0) problems.push(`${name} exited with ${step.status ?? "a signal"}`); + } + for (const [name, step] of named.slice(0, 2)) { + for (const line of step.output.split("\n")) { + if (/\bError\b|TTY/.test(line)) problems.push(`${name} reported: ${line.trim()}`); + } + } + if (!steps.check.output.includes("Everything's fine")) { + problems.push('drizzle-kit check did not report "Everything\'s fine"'); + } + if (!steps.generate.output.includes("No schema changes, nothing to migrate")) { + problems.push('drizzle-kit generate did not report "No schema changes, nothing to migrate"'); + } + const changed = steps.status.output.split("\n").filter((line) => line.trim() !== ""); + if (changed.length > 0) { + problems.push(`${MIGRATIONS} differs from what Git holds:\n${changed.join("\n")}`); + } + return problems; +} + +function run(command: string, args: string[], cwd: string): StepResult { + const result = spawnSync(command, args, { + cwd, + encoding: "utf8", + stdio: ["ignore", "pipe", "pipe"], + timeout: TIMEOUT_MS, + }); + const output = `${result.stdout ?? ""}${result.stderr ?? ""}`; + const error = result.error ? result.error.message : undefined; + return error === undefined + ? { status: result.status, output } + : { status: result.status, error, output }; +} + +if (process.argv[1] === fileURLToPath(import.meta.url)) { + const root = fileURLToPath(new URL("..", import.meta.url)); + const core = fileURLToPath(new URL("../packages/core/", import.meta.url)); + const check = run("pnpm", ["exec", "drizzle-kit", "check"], core); + const generate = run("pnpm", ["exec", "drizzle-kit", "generate"], core); + const status = run("git", ["status", "--porcelain", "--", MIGRATIONS], root); + const problems = driftProblems({ check, generate, status }); + if (problems.length > 0) { + console.error(`${check.output}${generate.output}`); + for (const problem of problems) console.error(`✗ ${problem}`); + console.error("See docs/database-migrations.md."); + process.exitCode = 1; + } else { + console.log("✓ migrations match the schema code"); + } +} diff --git a/scripts/gen-credentials.ts b/scripts/gen-credentials.ts index 2a87e4409..01f7a2633 100644 --- a/scripts/gen-credentials.ts +++ b/scripts/gen-credentials.ts @@ -7,6 +7,7 @@ import { configSchemaPropertiesFor, credentialsDocFor, envExampleFor, + FEEDS_PROCESS_DESCRIPTIONS, } from "./lib/gen-credentials-lib.js"; export interface GenPaths { @@ -30,8 +31,17 @@ interface ServiceJson { * a config field: OpenMapX resolves the field into the environment (or mounts * it as a secret file), and a hand-written entry would only hide that. */ -function nextServiceJson(svc: ServiceJson, catalog: CredentialCatalog): string { +function nextServiceJson( + svc: ServiceJson, + catalog: CredentialCatalog, + descriptions: Readonly> = {}, +): string { const properties = configSchemaPropertiesFor(catalog); + for (const [key, description] of Object.entries(descriptions)) { + const field = properties[key] as Record | undefined; + if (field === undefined) throw new Error(`no config field ${key} to describe`); + properties[key] = { ...field, description }; + } for (const key of Object.keys(svc.container?.environment ?? {})) { if (properties[key] !== undefined) { throw new Error( @@ -61,6 +71,13 @@ const DEFAULT_ENV_PREAMBLE = `# OpenConditions ingest — environment configurat # PostgreSQL/PostGIS connection (REQUIRED — the service refuses to start without it) DATABASE_URL=postgres://openconditions:openconditions@localhost:5432/openconditions +# Secrets key (REQUIRED): 64 hex characters, from \`openssl rand -hex 32\`, made +# once. The OAuth2 grants' tokens are encrypted with it; every other +# OpenConditions service of the instance gets a copy of this same key. Keep it in +# your recovery set and out of database backups. +# OPENCONDITIONS_SECRETS_KEY_FILE may name a file holding it instead. +OPENCONDITIONS_SECRETS_KEY= + # HTTP server (optional; defaults shown) PORT=4100 HOST=0.0.0.0 @@ -170,7 +187,10 @@ export function applyOrCheck( ]; if (paths.feedsServiceJson) { const feeds = JSON.parse(readFileSync(paths.feedsServiceJson, "utf8")) as ServiceJson; - targets.push([paths.feedsServiceJson, nextServiceJson(feeds, catalog)]); + targets.push([ + paths.feedsServiceJson, + nextServiceJson(feeds, catalog, FEEDS_PROCESS_DESCRIPTIONS), + ]); } const drift: string[] = []; for (const [file, next] of targets) { diff --git a/scripts/lib/gen-credentials-lib.ts b/scripts/lib/gen-credentials-lib.ts index 5ee3d4524..0fee6a383 100644 --- a/scripts/lib/gen-credentials-lib.ts +++ b/scripts/lib/gen-credentials-lib.ts @@ -152,6 +152,16 @@ interface ServiceField { default?: string; } +/** + * The descriptions the heavy-feeds ingest manifest gives in place of the + * ingest service's: it holds the key the ingest service generated and never + * generates its own. + */ +export const FEEDS_PROCESS_DESCRIPTIONS: Readonly> = { + OPENCONDITIONS_SECRETS_KEY: + "Required. Copy the value of openconditions-ingest's Secrets key; never generate a new one. The OAuth grant tokens this process refreshes are encrypted with it, and it refuses to start with any other key. It is not recoverable from the OpenConditions tables: the copy in your recovery set is the ingest service's.", +}; + /** * The ingest service's own configuration, hand-written here and written into * `service.json` beside the fields generated from the catalogue. Under @@ -174,6 +184,12 @@ export const SERVICE_FIELDS: Readonly> = { "Required. PostgreSQL/PostGIS connection URL of the shared OpenMapX database for a dedicated role, e.g. postgresql://openconditions_ingest:@openmapx-postgis:5432/openmapx. Never use the PostgreSQL superuser; create the role as OpenMapX's community extensions guide describes. The service refuses to start without it.", secret: true, }, + OPENCONDITIONS_SECRETS_KEY: { + title: "Secrets key", + description: + "Required. The key the OAuth grant tokens and the instance's private keys are encrypted with in the OpenConditions tables: 64 hexadecimal characters. Generate it here, once, with openssl rand -hex 32, then copy this same value into the Secrets key of every other OpenConditions service of this instance (the heavy-feeds ingest, contributions API and federation); each refuses to start with another key. It is not recoverable from the OpenConditions tables: keep a copy in your recovery set. Under OpenMapX this vault stores it encrypted with OpenMapX's own secrets key, so a database backup protects it only while that key stays out of the backup, and both keys belong in the recovery set. Losing it means logging in to every OAuth grant again and making new issuer and federation keys, which changes the federation identity. The service refuses to start without it, or with a key that cannot decrypt what is stored.", + secret: true, + }, OPENCONDITIONS_OPERATOR_TOKEN: { title: "Operator token", description: diff --git a/scripts/postgis-global-setup.integration.ts b/scripts/postgis-global-setup.integration.ts index 157909d7b..550310bb7 100644 --- a/scripts/postgis-global-setup.integration.ts +++ b/scripts/postgis-global-setup.integration.ts @@ -1,6 +1,7 @@ import { runMigrations } from "@openconditions/core/server"; import { assertPostgisProfile, + createGranteeRoles, POSTGIS_IMAGES, postgisProfile, } from "@openconditions/test-database"; @@ -28,6 +29,9 @@ export default async function setup(project: TestProject): Promise<() => Promise containerId: container.getId(), }); await runMigrations(`${server}/${TEMPLATE}`); + // The roles the migration grants to exist from here on, so a clone of + // the template is a database migrated before they were created. + await createGranteeRoles(adminUrl); // Cloning needs the template free of sessions; refusing them keeps it so. await admin.unsafe( `ALTER DATABASE "${TEMPLATE}" WITH IS_TEMPLATE true ALLOW_CONNECTIONS false`, diff --git a/scripts/qualify-container-images.py b/scripts/qualify-container-images.py index 15872e20b..051491fe9 100755 --- a/scripts/qualify-container-images.py +++ b/scripts/qualify-container-images.py @@ -98,12 +98,13 @@ def write_json(path, value): stream.write("\n") -def command(args, *, cwd=None, log=None, check=True, timeout=120): +def command(args, *, cwd=None, log=None, check=True, timeout=120, stdin=None): if args[0] == "git": args = ["git", "--no-replace-objects", *args[1:]] result = subprocess.run( args, cwd=cwd, + input=stdin, text=True, stdout=log or subprocess.PIPE, stderr=subprocess.STDOUT if log else subprocess.PIPE, @@ -549,6 +550,67 @@ def remove_owned(kind, name, label): """ +# The ingest service's key check, sealed with only what the contributions-api +# image ships (its core code is bundled, not importable). It is a second copy +# of the sealed format: AES-256-GCM, a 12-byte IV, a 16-byte tag and the +# place as additional data. The service verifies the row with its own code at +# start, so a copy that drifts leaves it unhealthy and fails qualification. +SEAL_SECRETS_KEY_CHECK = """ +import { createCipheriv, randomBytes } from "node:crypto"; +import postgres from "postgres"; +const key = Buffer.from(process.env.OPENCONDITIONS_SECRETS_KEY, "hex"); +if (key.length !== 32) throw new Error("the secrets key is not 32 bytes"); +const iv = randomBytes(12); +const cipher = createCipheriv("aes-256-gcm", key, iv, { authTagLength: 16 }); +cipher.setAAD(Buffer.from(JSON.stringify(["conditions", "secrets_key_check", "value", "1"]), "utf8")); +const ciphertext = Buffer.concat([ + cipher.update("openconditions secrets key check", "utf8"), + cipher.final(), +]); +const tag = cipher.getAuthTag(); +const sql = postgres(process.env.DATABASE_URL, { max: 1 }); +try { + await sql` + INSERT INTO conditions.secrets_key_check (id, value_ciphertext, value_iv, value_tag) + VALUES (1, ${ciphertext}, ${iv}, ${tag}) + ON CONFLICT (id) DO NOTHING`; +} finally { + await sql.end(); +} +""" + + +def ingest_migration_script(source): + """The source's migrations, recorded in conditions.__drizzle_migrations as the + ingest service's migrator records them (the file's SHA-256 and its journal `when`). + The contributions and federation services apply no migrations: they wait at boot + until that history reaches their build's latest journal entry.""" + folder = source / "packages/core/drizzle" + journal = decode((folder / "meta/_journal.json").read_bytes()) + parts = [ + "CREATE EXTENSION IF NOT EXISTS postgis;", + "CREATE SCHEMA IF NOT EXISTS conditions;", + "CREATE TABLE IF NOT EXISTS conditions.__drizzle_migrations " + "(id SERIAL PRIMARY KEY, hash text NOT NULL, created_at bigint);", + ] + for entry in journal["entries"]: + tag, when = entry["tag"], entry["when"] + if not re.fullmatch(r"[0-9]{4}_[a-z0-9_]+", tag) or type(when) is not int: + fail("unexpected migrations journal entry") + body = (folder / f"{tag}.sql").read_bytes().decode("utf-8") + # drizzle runs each breakpoint chunk as its own query, so a chunk may + # end without a semicolon; psql reads one script, which needs it. + for chunk in body.split("--> statement-breakpoint"): + statement = chunk.strip() + if statement: + parts.append(statement if statement.endswith(";") else f"{statement}\n;") + parts.append( + "INSERT INTO conditions.__drizzle_migrations (hash, created_at) " + f"VALUES ('{hashlib.sha256(body.encode()).hexdigest()}', {when});" + ) + return "\n".join(parts) + "\n" + + def runtime_smoke(image, identity, source, output, *, exercise=None): label = uuid.uuid4().hex network, db, app = [f"oc-image-{label}{suffix}" for suffix in ("", "-db", "-app")] @@ -627,7 +689,7 @@ def runtime_smoke(image, identity, source, output, *, exercise=None): POSTGIS, ] ) - sql = [ + psql = [ "docker", "exec", "-e", @@ -640,8 +702,8 @@ def runtime_smoke(image, identity, source, output, *, exercise=None): "fixture", "-d", "fixture", - "-Atqc", ] + sql = [*psql, "-Atqc"] deadline = time.monotonic() + 120 while command([*sql, "select 1"], check=False).returncode: if time.monotonic() > deadline: @@ -653,6 +715,21 @@ def runtime_smoke(image, identity, source, output, *, exercise=None): if not re.fullmatch(r"16[0-9]{4}\|3\.[0-9.]+", physical): fail("unexpected physical PostGIS version") record["physicalPostGIS"] = physical + if image in ("contributions-api", "federation"): + command( + [ + *psql[:2], + "-i", + *psql[2:], + "-v", + "ON_ERROR_STOP=1", + "--single-transaction", + "-q", + "-f", + "-", + ], + stdin=ingest_migration_script(source), + ) env = { "DATABASE_URL": f"postgresql://fixture:fixture@{db}:5432/fixture", "HOST": "0.0.0.0", @@ -661,7 +738,35 @@ def runtime_smoke(image, identity, source, output, *, exercise=None): "OPENCONDITIONS_FEEDS_REMOTE_ENABLED": "false", "OPENCONDITIONS_GRANT_SECRET": uuid.uuid4().hex + uuid.uuid4().hex, "OPENCONDITIONS_REVIEWER_TOKEN": uuid.uuid4().hex + uuid.uuid4().hex, + "OPENCONDITIONS_SECRETS_KEY": uuid.uuid4().hex + uuid.uuid4().hex, } + if image == "contributions-api": + # The ingest service seals the secrets key check after migrating, + # and this service waits for it; seal it as ingest does, inside + # the image, before the service starts. + command( + [ + "docker", + "run", + "--rm", + "--label", + f"openconditions.qualification={label}", + "--network", + network, + "--platform", + PLATFORM, + "-e", + f"DATABASE_URL={env['DATABASE_URL']}", + "-e", + f"OPENCONDITIONS_SECRETS_KEY={env['OPENCONDITIONS_SECRETS_KEY']}", + "--entrypoint", + "node", + loaded, + "--input-type=module", + "-e", + SEAL_SECRETS_KEY_CHECK, + ] + ) args = [ "docker", "run", @@ -729,7 +834,7 @@ def runtime_smoke(image, identity, source, output, *, exercise=None): ).stdout.strip() ) if tables < 10: - fail("bundled migrations were not applied") + fail("migrations were not applied") record["checks"]["migratedTables"] = tables if image == "ingest": record["checks"]["osmiumVersion"] = command( diff --git a/services/contributions-api/README.md b/services/contributions-api/README.md index 799eb8f58..5119ad49a 100644 --- a/services/contributions-api/README.md +++ b/services/contributions-api/README.md @@ -59,31 +59,20 @@ operator's erasure (see `docs/federation-gdpr.md`). ## Configuration -| Variable | Meaning | Default | -| -------------------------------------- | ----------------------------------------------------------------------------------------------- | ---------------------------------- | -| `DATABASE_URL` | PostgreSQL/PostGIS connection URL. Required. | none | -| `OPENCONDITIONS_GRANT_SECRET` | HMAC secret signing reporting grants. Required in production. | ephemeral outside production | -| `OPENCONDITIONS_REVIEWER_TOKEN` | Bearer token of the reviewer surface. Required in production. | ephemeral outside production | -| `OPENCONDITIONS_ISSUER_NAME` | TokenChallenge issuer name. | `contributions.openconditions.org` | -| `OPENCONDITIONS_CROSS_VALIDATE_SWEEP` | `off` stops the sweep that retries cross-validation of unresolved crowd reports. | on | -| `OPENCONDITIONS_INSTANCE_ID` | This instance's id, the namespace of the crowd records it lands; the ingest service's. | `local` | -| `OPENCONDITIONS_CROWD_LICENSE` | Licence of this instance's crowd reports (an id of the licence registry); the ingest service's. | `ODbL-1.0` | -| `OPENCONDITIONS_CROWD_SOURCE_URI` | Link the crowd's credit carries, an http(s) URL; the ingest service's. | none | -| `OPENCONDITIONS_ALLOW_POLICE_CATEGORY` | `true` lets crowd reports of police presence land. | off | +| Variable | Meaning | Default | +| --------------------------------------- | ----------------------------------------------------------------------------------------------- | ---------------------------------- | +| `DATABASE_URL` | PostgreSQL/PostGIS connection URL. Required. | none | +| `OPENCONDITIONS_GRANT_SECRET` | HMAC secret signing reporting grants. Required in production. | ephemeral outside production | +| `OPENCONDITIONS_REVIEWER_TOKEN` | Bearer token of the reviewer surface. Required in production. | ephemeral outside production | +| `OPENCONDITIONS_SECRETS_KEY` | Key the issuer's private keys are encrypted with; the ingest service's. Required. | none | +| `OPENCONDITIONS_ISSUER_NAME` | TokenChallenge issuer name. | `contributions.openconditions.org` | +| `OPENCONDITIONS_CROSS_VALIDATE_SWEEP` | `off` stops the sweep that retries cross-validation of unresolved crowd reports. | on | +| `OPENCONDITIONS_INSTANCE_ID` | This instance's id, the namespace of the crowd records it lands; the ingest service's. | `local` | +| `OPENCONDITIONS_CROWD_LICENSE` | Licence of this instance's crowd reports (an id of the licence registry); the ingest service's. | `ODbL-1.0` | +| `OPENCONDITIONS_CROWD_SOURCE_URI` | Link the crowd's credit carries, an http(s) URL; the ingest service's. | none | +| `OPENCONDITIONS_ALLOW_POLICE_CATEGORY` | `true` lets crowd reports of police presence land. | off | +| `OPENCONDITIONS_SCHEMA_WAIT_TIMEOUT_MS` | How long the service waits at start for the schema version, in milliseconds. | 300000 | -Each of the three secrets may instead be a file named by `_FILE`. Under -OpenMapX the service is a community service whose `container.environment` -reaches the container verbatim, so `service.json` declares these as -`configSchema` fields. The secrets are vault secrets the operator sets once in -the admin services panel (`openconditions-contributions-api`, Credentials); -OpenMapX mounts each as a file and sets `_FILE`. On the shared OpenMapX -database `DATABASE_URL` connects as this service's own role, for example -`postgresql://openconditions_contributions:@openmapx-postgis:5432/openmapx`. -Never use the PostgreSQL superuser: create the role as OpenMapX's community -extensions guide describes. The -settings are set in the same panel, or as -`SERVICE_OPENCONDITIONS_CONTRIBUTIONS_API_` in OpenMapX's `.env`. -Settings kept in OpenMapX's `.env` are applied with -`pnpm openmapx services start openconditions-contributions-api` (which resets -every setting saved only in the admin form, so keep all of them in one place). -Settings saved in the form are applied with **Save & Apply**. +Each of the four secrets may instead be a file named by `_FILE`. The secrets key is a copy of the ingest service's, never a newly generated one: after the schema version the service waits for the ingest service's key check (`conditions.secrets_key_check`) and refuses to start when its key does not open it; see [Secrets encrypted at rest](../../README.md#secrets-encrypted-at-rest). Under OpenMapX the service is a community service whose `container.environment` reaches the container verbatim, so `service.json` declares these as `configSchema` fields. The secrets are vault secrets the operator sets once in the admin services panel (`openconditions-contributions-api`, Credentials); OpenMapX mounts each as a file and sets `_FILE`. On the shared OpenMapX database `DATABASE_URL` connects as this service's own role, for example `postgresql://openconditions_contributions:@openmapx-postgis:5432/openmapx`. Never use the PostgreSQL superuser: create the role as OpenMapX's community extensions guide describes. The settings are set in the same panel, or as `SERVICE_OPENCONDITIONS_CONTRIBUTIONS_API_` in OpenMapX's `.env`. Settings kept in OpenMapX's `.env` are applied with `pnpm openmapx services start openconditions-contributions-api` (which resets every setting saved only in the admin form, so keep all of them in one place). Settings saved in the form are applied with **Save & Apply**. + +The service applies no migrations. The ingest service migrates the `conditions` schema; at start this service waits until `conditions.__drizzle_migrations` records the latest migration this build ships, or a later one, polling every two seconds. After `OPENCONDITIONS_SCHEMA_WAIT_TIMEOUT_MS` it stops and names the version it expected and what it found. Its role needs no DDL rights. After every migrate the ingest service grants `openconditions_contributions` the read of that table and exactly the privileges the service's queries use. Create the role before the ingest service first starts; one created later gets its grants when the ingest service restarts. See [database roles and grants](../../docs/database-migrations.md#database-roles-and-grants). diff --git a/services/contributions-api/service.json b/services/contributions-api/service.json index da366893a..4108e8c20 100644 --- a/services/contributions-api/service.json +++ b/services/contributions-api/service.json @@ -49,6 +49,12 @@ "description": "Required. PostgreSQL/PostGIS connection URL of the shared OpenMapX database for this service's own role, e.g. postgresql://openconditions_contributions:@openmapx-postgis:5432/openmapx. Never use the PostgreSQL superuser; create the role as OpenMapX's community extensions guide describes. The service refuses to start without it.", "x-openmapx-secret": true }, + "OPENCONDITIONS_SECRETS_KEY": { + "type": "string", + "title": "Secrets key", + "description": "Required. Copy the value of openconditions-ingest's Secrets key; never generate a new one. The token issuer's private keys are encrypted with it, and the service refuses to start with a key other than the one the ingest service holds, or one that cannot decrypt the stored issuer keys. It is not recoverable from the OpenConditions tables: the copy in your recovery set is the ingest service's.", + "x-openmapx-secret": true + }, "OPENCONDITIONS_GRANT_SECRET": { "type": "string", "title": "Reporting grant secret", @@ -68,6 +74,13 @@ "default": "", "x-openmapx-secret": false }, + "OPENCONDITIONS_SCHEMA_WAIT_TIMEOUT_MS": { + "type": "string", + "title": "Schema wait timeout (ms)", + "description": "The ingest service migrates the database; this service waits at start until the schema is at its version or newer, and stops with what it expected and found after this long. Empty: 300000.", + "default": "", + "x-openmapx-secret": false + }, "OPENCONDITIONS_ISSUER_NAME": { "type": "string", "title": "Issuer name", diff --git a/services/contributions-api/src/__tests__/abuse.integration.test.ts b/services/contributions-api/src/__tests__/abuse.integration.test.ts index 96058f1ec..439547180 100644 --- a/services/contributions-api/src/__tests__/abuse.integration.test.ts +++ b/services/contributions-api/src/__tests__/abuse.integration.test.ts @@ -1,7 +1,11 @@ import { readFileSync } from "node:fs"; import { generateReporterKey, type ReporterKey } from "@openconditions/contrib-core"; import { crowdLocalId } from "@openconditions/model"; -import { createTestDatabase, type TestDatabase } from "@openconditions/test-database"; +import { + createTestDatabase, + TEST_SECRETS_KEY, + type TestDatabase, +} from "@openconditions/test-database"; import type { FastifyInstance } from "fastify"; import type postgres from "postgres"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; @@ -26,6 +30,7 @@ beforeAll(async () => { sql, env: { OPENCONDITIONS_GRANT_SECRET: GRANT_SECRET_VALUE, + OPENCONDITIONS_SECRETS_KEY: TEST_SECRETS_KEY, OPENCONDITIONS_INSTANCE_ID: INSTANCE, }, logger: false, @@ -376,6 +381,12 @@ describe("co-reporting monitoring view", () => { kind: "report" | "confirm" | "negate", occurredAt: string, ): Promise { + // Evidence names a key only of an enrolled reporter. + await sql` + INSERT INTO conditions.reporter (key_id, pub_jwk, reputation_alpha, reputation_beta, + entitlement_expires_at, created_at, last_active_at) + VALUES (${keyId}, '{}'::jsonb, 1, 1, ${occurredAt}, ${occurredAt}, ${occurredAt}) + ON CONFLICT (key_id) DO NOTHING`; await sql` INSERT INTO conditions.report_evidence (record_class, record_id, evidence_kind, actor_key_id, occurred_at, details) diff --git a/services/contributions-api/src/__tests__/attester-issuer.integration.test.ts b/services/contributions-api/src/__tests__/attester-issuer.integration.test.ts index a7ef1e377..ac3306d05 100644 --- a/services/contributions-api/src/__tests__/attester-issuer.integration.test.ts +++ b/services/contributions-api/src/__tests__/attester-issuer.integration.test.ts @@ -1,6 +1,14 @@ +import { createHash } from "node:crypto"; import { publicVerif, type Token } from "@cloudflare/privacypass-ts"; import { generateReporterKey, type ReporterKey } from "@openconditions/contrib-core"; -import { createTestDatabase, type TestDatabase } from "@openconditions/test-database"; +import { SecretsKey, sealSecretsKeyCheck, storedSecret } from "@openconditions/core/server"; +import { + createTestDatabase, + dumpHolds, + dumpTable, + TEST_SECRETS_KEY, + type TestDatabase, +} from "@openconditions/test-database"; import type { FastifyInstance } from "fastify"; import type postgres from "postgres"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; @@ -9,7 +17,12 @@ import { verifyReportingGrant } from "../attester/grant.js"; import type { DeviceProof } from "../attester/policy.js"; import { type PublicContext, publicContextString, redemptionContext } from "../issuer/context.js"; import { issueToken } from "../issuer/issue.js"; -import { DEFAULT_ISSUER_NAME, generateIssuerKey, loadActiveIssuerKeys } from "../issuer/keys.js"; +import { + assertIssuerKeysOpen, + DEFAULT_ISSUER_NAME, + generateIssuerKey, + loadActiveIssuerKeys, +} from "../issuer/keys.js"; import { TokenVerifier } from "../issuer/verify.js"; import { build } from "../server.js"; @@ -18,6 +31,7 @@ const { BlindRSAMode, Client, Origin, TokenResponse } = publicVerif; const NOW = "2026-07-12T08:00:00.000Z"; const GRANT_SECRET_VALUE = "attester-issuer-test-secret"; const GRANT_SECRET = new TextEncoder().encode(GRANT_SECRET_VALUE); +const secrets = SecretsKey.parse(TEST_SECRETS_KEY); const noopLog = { info: () => {}, @@ -41,6 +55,14 @@ function proofFor(key: ReporterKey, overrides: Partial = {}): Devic return { keyId: key.keyId, ...overrides }; } +/** When the spent row of `tokenBytes` expires. */ +async function spentExpiry(tokenBytes: Uint8Array): Promise { + const hash = createHash("sha256").update(tokenBytes).digest("hex"); + const [row] = await sql<{ expires_at: Date }[]>` + SELECT expires_at FROM conditions.spent_token WHERE token_hash = ${hash}`; + return row?.expires_at.toISOString(); +} + async function enroll(key: ReporterKey, now = NOW) { return enrollReporter(sql, key.publicJwk, proofFor(key), now, { grantSecret: GRANT_SECRET, @@ -230,7 +252,7 @@ describe("enrollReporter", () => { it("a verifier-CONFIRMED osmAuth grants the 0.1 bump", async () => { const key = await generateReporterKey(); const confirming = { - verify: async () => ({ verified: true, osmUid: "12345" }), + verify: async () => ({ verified: true }), }; const entitlement = await enrollReporter( sql, @@ -335,7 +357,7 @@ async function mintDirect( ctx: PublicContext, opts: { pickKeyId?: string } = {}, ): Promise { - const keys = await loadActiveIssuerKeys(sql, NOW, DEFAULT_ISSUER_NAME); + const keys = await loadActiveIssuerKeys(sql, secrets, NOW, DEFAULT_ISSUER_NAME); const issuerKey = opts.pickKeyId === undefined ? keys[0]! : keys.find((k) => k.keyId === opts.pickKeyId)!; const client = new Client(BlindRSAMode.PSS); @@ -344,6 +366,7 @@ async function mintDirect( const request = await client.createTokenRequest(challenge, issuerKey.publicKeyBytes); const result = await issueToken(sql, keyId, epoch, request.serialize(), ctx, { log: noopLog, + secrets, now: NOW, }); if (!result.issued) throw new Error(`issuance refused: ${result.reason}`); @@ -353,8 +376,8 @@ async function mintDirect( describe("issuer keys", () => { it("bootstraps a keypair on first use and reloads it as valid", async () => { - const created = await generateIssuerKey(sql, NOW); - const keys = await loadActiveIssuerKeys(sql, NOW, DEFAULT_ISSUER_NAME); + const created = await generateIssuerKey(sql, secrets, NOW); + const keys = await loadActiveIssuerKeys(sql, secrets, NOW, DEFAULT_ISSUER_NAME); expect(keys.length).toBeGreaterThanOrEqual(1); const found = keys.find((k) => k.keyId === created.keyId); expect(found).toBeDefined(); @@ -363,13 +386,62 @@ describe("issuer keys", () => { }, 60_000); it("excludes keys outside their validity window", async () => { - const expired = await generateIssuerKey(sql, NOW, { + const expired = await generateIssuerKey(sql, secrets, NOW, { notBefore: "2026-01-01T00:00:00.000Z", notAfter: "2026-04-01T00:00:00.000Z", }); - const keys = await loadActiveIssuerKeys(sql, NOW, DEFAULT_ISSUER_NAME); + const keys = await loadActiveIssuerKeys(sql, secrets, NOW, DEFAULT_ISSUER_NAME); expect(keys.find((k) => k.keyId === expired.keyId)).toBeUndefined(); }, 60_000); + + it("stores the private key sealed: a dump of the table does not hold it", async () => { + const [row] = await sql`SELECT * FROM conditions.issuer_key LIMIT 1`; + const place = { table: "issuer_key", column: "private_key", row: row!["key_id"] as string }; + const pkcs8 = secrets.open(storedSecret(row!, place)!, place); + // The opened value is the key's PKCS#8 form, which the dump must not hold. + await expect( + globalThis.crypto.subtle.importKey( + "pkcs8", + new Uint8Array(pkcs8), + publicVerif.BLIND_RSA.rsaParams, + false, + ["sign"], + ), + ).resolves.toBeDefined(); + expect(dumpHolds(await dumpTable(sql, "issuer_key"), pkcs8)).toBe(false); + expect(row!["private_key_iv"]).toHaveLength(12); + expect(row!["private_key_tag"]).toHaveLength(16); + }, 60_000); + + it("refuses a key that cannot open the stored private keys, naming the key id", async () => { + await expect(assertIssuerKeysOpen(sql, secrets)).resolves.toBeUndefined(); + const wrong = SecretsKey.parse("e1".repeat(32)); + await expect(assertIssuerKeysOpen(sql, wrong)).rejects.toThrow( + /^wrong key: OPENCONDITIONS_SECRETS_KEY cannot decrypt conditions\.issuer_key\.private_key of the row [0-9a-f]{64}/, + ); + }, 60_000); + + it("does not open a private key copied into another key's row", async () => { + const [a] = await loadActiveIssuerKeys(sql, secrets, NOW, DEFAULT_ISSUER_NAME); + const b = await generateIssuerKey(sql, secrets, NOW); + const rollBack = new Error("roll the copy back"); + await expect( + sql.begin(async (tx) => { + await tx` + UPDATE conditions.issuer_key AS b SET + private_key_ciphertext = a.private_key_ciphertext, + private_key_iv = a.private_key_iv, + private_key_tag = a.private_key_tag + FROM conditions.issuer_key AS a + WHERE a.key_id = ${a!.keyId} AND b.key_id = ${b.keyId}`; + await expect(loadActiveIssuerKeys(tx, secrets, NOW, DEFAULT_ISSUER_NAME)).rejects.toThrow( + `cannot decrypt conditions.issuer_key.private_key of the row ${b.keyId}`, + ); + throw rollBack; + }), + ).rejects.toBe(rollBack); + await expect(assertIssuerKeysOpen(sql, secrets)).resolves.toBeUndefined(); + }, 60_000); }); describe("issuance + redemption round-trip (real privacypass-ts client)", () => { @@ -405,6 +477,8 @@ describe("issuance + redemption round-trip (real privacypass-ts client)", () => await expect( verifier.verify(sql, garbage, { purpose: "report", epoch: "x" }, NOW), ).resolves.toBe(false); + // It can never redeem, so its spent row may go at once. + expect(await spentExpiry(garbage)).toBe(NOW); }, 30_000); it("refuses issuance for a reporter blocked after the grant was minted", async () => { @@ -423,7 +497,7 @@ describe("quota under concurrency", () => { await enroll(key); const epoch = "conc-2026-07-12"; const ctx: PublicContext = { purpose: "report", epoch }; - const keys = await loadActiveIssuerKeys(sql, NOW, DEFAULT_ISSUER_NAME); + const keys = await loadActiveIssuerKeys(sql, secrets, NOW, DEFAULT_ISSUER_NAME); const issuerKey = keys[0]!; const origin = new Origin(BlindRSAMode.PSS); const challenge = origin.createTokenChallenge( @@ -441,7 +515,7 @@ describe("quota under concurrency", () => { const results = await Promise.all( requests.map((bytes) => - issueToken(sql, key.keyId, epoch, bytes, ctx, { log: noopLog, now: NOW }), + issueToken(sql, key.keyId, epoch, bytes, ctx, { log: noopLog, secrets, now: NOW }), ), ); const succeeded = results.filter((r) => r.issued); @@ -461,11 +535,11 @@ describe("quota under concurrency", () => { describe("issuer key rotation", () => { it("a token blinded against an old-but-still-valid key verifies within the overlap", async () => { - const old = await generateIssuerKey(sql, NOW, { + const old = await generateIssuerKey(sql, secrets, NOW, { notBefore: "2026-05-01T00:00:00.000Z", notAfter: "2026-08-01T00:00:00.000Z", }); - await generateIssuerKey(sql, NOW); + await generateIssuerKey(sql, secrets, NOW); const key = await generateReporterKey(); await enroll(key); @@ -476,15 +550,63 @@ describe("issuer key rotation", () => { const verifier = new TokenVerifier({ issuerName: DEFAULT_ISSUER_NAME, log: noopLog }); await expect(verifier.verify(sql, tokenBytes, ctx, NOW)).resolves.toBe(true); + // The spent row lives as long as the key the token was issued under. + expect(await spentExpiry(tokenBytes)).toBe("2026-08-01T00:00:00.000Z"); }, 120_000); }); describe("build() fail-closed", () => { it("throws in production when OPENCONDITIONS_GRANT_SECRET is unset", async () => { - await expect(build({ sql, env: { NODE_ENV: "production" } })).rejects.toThrow( - /OPENCONDITIONS_GRANT_SECRET/, + await expect( + build({ + sql, + env: { NODE_ENV: "production", OPENCONDITIONS_SECRETS_KEY: TEST_SECRETS_KEY }, + }), + ).rejects.toThrow(/OPENCONDITIONS_GRANT_SECRET/); + }, 30_000); + + it("throws without a secrets key, or with one that is no key", async () => { + const env = { OPENCONDITIONS_GRANT_SECRET: GRANT_SECRET_VALUE }; + await expect(build({ sql, env, logger: false })).rejects.toThrow( + /OPENCONDITIONS_SECRETS_KEY is required: set OPENCONDITIONS_SECRETS_KEY_FILE/, ); + await expect( + build({ sql, env: { ...env, OPENCONDITIONS_SECRETS_KEY: "0".repeat(63) }, logger: false }), + ).rejects.toThrow(/OPENCONDITIONS_SECRETS_KEY must be 64 hexadecimal characters/); + }, 30_000); + + it("throws with a key that cannot open the stored issuer keys", async () => { + await expect( + build({ + sql, + env: { + OPENCONDITIONS_GRANT_SECRET: GRANT_SECRET_VALUE, + OPENCONDITIONS_SECRETS_KEY: "f0".repeat(32), + }, + logger: false, + }), + ).rejects.toThrow(/^wrong key: .*conditions\.issuer_key\.private_key of the row /); }, 30_000); + + it("throws with a key other than the one the ingest service sealed the key check with", async () => { + const env = { OPENCONDITIONS_GRANT_SECRET: GRANT_SECRET_VALUE }; + await sealSecretsKeyCheck(sql, secrets); + try { + const matching = await build({ + sql, + env: { ...env, OPENCONDITIONS_SECRETS_KEY: TEST_SECRETS_KEY }, + logger: false, + }); + await matching.close(); + await expect( + build({ sql, env: { ...env, OPENCONDITIONS_SECRETS_KEY: "0e".repeat(32) }, logger: false }), + ).rejects.toThrow( + /OPENCONDITIONS_SECRETS_KEY differs from the key the ingest service sealed/, + ); + } finally { + await sql`TRUNCATE conditions.secrets_key_check`; + } + }, 60_000); }); interface CapturedLine { @@ -519,7 +641,10 @@ describe("HTTP surface + end-to-end flow with log separation", () => { capture = captureLogger(); app = await build({ sql, - env: { OPENCONDITIONS_GRANT_SECRET: GRANT_SECRET_VALUE }, + env: { + OPENCONDITIONS_GRANT_SECRET: GRANT_SECRET_VALUE, + OPENCONDITIONS_SECRETS_KEY: TEST_SECRETS_KEY, + }, logger: capture.logger, // Pin the clock so the SERVER-derived report epoch is a fixed UTC day. now: () => NOW, diff --git a/services/contributions-api/src/__tests__/attester-verifier.test.ts b/services/contributions-api/src/__tests__/attester-verifier.test.ts index b6e2bc653..61bbf5989 100644 --- a/services/contributions-api/src/__tests__/attester-verifier.test.ts +++ b/services/contributions-api/src/__tests__/attester-verifier.test.ts @@ -31,7 +31,7 @@ describe("UNVERIFIED_OSM_AUTH default verifier", () => { const result = await UNVERIFIED_OSM_AUTH.verify("anything-a-sybil-sends", { keyId: "key-1" }); expect(result.verified).toBe(false); expect(result.reason).toBe("no-osm-verifier-configured"); - expect(result.osmUid).toBeUndefined(); + expect(Object.keys(result).sort()).toEqual(["reason", "verified"]); }); it("satisfies the OsmAuthVerifier contract", () => { diff --git a/services/contributions-api/src/__tests__/corroborate.integration.test.ts b/services/contributions-api/src/__tests__/corroborate.integration.test.ts index 4b9dc2a65..5772569e2 100644 --- a/services/contributions-api/src/__tests__/corroborate.integration.test.ts +++ b/services/contributions-api/src/__tests__/corroborate.integration.test.ts @@ -99,6 +99,24 @@ describe("applyCorroboration", () => { expect(await evidenceOf(sql, late)).toMatchObject({ tombstone_reason: "superseded" }); }, 30_000); + it("credits no key for a merged report whose reporter has since been deleted", async () => { + const early = await report(alice, T_EARLY); + const late = await report(bob, T_LATE); + // The late report's record still names bob in its provenance. + await sql`DELETE FROM conditions.reporter WHERE key_id = ${bob.keyId}`; + + await applyCorroboration(sql, registry, late, early, T_MERGE); + + const confirms = await confirmsOf(early); + expect(confirms).toHaveLength(1); + expect(confirms[0]).toMatchObject({ + actor_key_id: null, + source_id: "crowd", + details: { via: "phenomenon-match", merged: late }, + }); + expect(await evidenceOf(sql, late)).toMatchObject({ tombstone_reason: "superseded" }); + }, 30_000); + it("is COMMUTATIVE: the earlier report survives regardless of argument order", async () => { for (const reversed of [false, true]) { await sql`TRUNCATE conditions.situation, conditions.report_evidence CASCADE`; diff --git a/services/contributions-api/src/__tests__/issuer-key-collision.integration.test.ts b/services/contributions-api/src/__tests__/issuer-key-collision.integration.test.ts index e41d001d2..359e14fb8 100644 --- a/services/contributions-api/src/__tests__/issuer-key-collision.integration.test.ts +++ b/services/contributions-api/src/__tests__/issuer-key-collision.integration.test.ts @@ -1,6 +1,11 @@ import { publicVerif } from "@cloudflare/privacypass-ts"; import { generateReporterKey } from "@openconditions/contrib-core"; -import { createTestDatabase, type TestDatabase } from "@openconditions/test-database"; +import { SecretsKey } from "@openconditions/core/server"; +import { + createTestDatabase, + TEST_SECRETS_KEY, + type TestDatabase, +} from "@openconditions/test-database"; import type postgres from "postgres"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; import { enrollReporter } from "../attester/enroll.js"; @@ -17,6 +22,7 @@ import { TokenVerifier } from "../issuer/verify.js"; const { BlindRSAMode, Client, Issuer, Origin, TokenResponse, getPublicKeyBytes } = publicVerif; const NOW = "2026-07-12T08:00:00.000Z"; +const secrets = SecretsKey.parse(TEST_SECRETS_KEY); const GRANT_SECRET = new TextEncoder().encode("issuer-key-collision-test-secret"); const noopLog = { info: () => {}, warn: () => {}, error: () => {} }; @@ -158,8 +164,8 @@ function barrieredGenerator(sequence: KeyPair[], barrier: () => Promise) { describe("truncated-key-id reserved-byte derivation", () => { it("the last hex byte of key_id equals loadActiveIssuerKeys' truncatedTokenKeyId", async () => { - const { keyId } = await generateIssuerKey(sql, NOW); - const keys = await loadActiveIssuerKeys(sql, NOW, DEFAULT_ISSUER_NAME); + const { keyId } = await generateIssuerKey(sql, secrets, NOW); + const keys = await loadActiveIssuerKeys(sql, secrets, NOW, DEFAULT_ISSUER_NAME); const key = keys.find((k) => k.keyId === keyId)!; expect(parseInt(keyId.slice(-2), 16)).toBe(key.truncatedTokenKeyId); }, 60_000); @@ -175,12 +181,12 @@ describe("generateIssuerKey truncated-id collision avoidance", () => { // Seed one active key in the window; it inserts cleanly (no collision yet). const seed = scriptedGenerator([k1!]); - await generateIssuerKey(sql, NOW, { ...window, generateKeyPair: seed.generate }); + await generateIssuerKey(sql, secrets, NOW, { ...window, generateKeyPair: seed.generate }); expect(seed.state.calls).toBe(1); // The next candidate collides (same keypair/byte) and MUST be regenerated. const colliding = scriptedGenerator([k1!, k2!]); - const created = await generateIssuerKey(sql, NOW, { + const created = await generateIssuerKey(sql, secrets, NOW, { ...window, generateKeyPair: colliding.generate, }); @@ -206,12 +212,12 @@ describe("generateIssuerKey truncated-id collision avoidance", () => { }; const [k1] = await distinctKeyPairs(1); const seed = scriptedGenerator([k1!]); - await generateIssuerKey(sql, NOW, { ...window, generateKeyPair: seed.generate }); + await generateIssuerKey(sql, secrets, NOW, { ...window, generateKeyPair: seed.generate }); // Every candidate collides with the seeded key; bounded retries then throw. const stuck = scriptedGenerator([k1!]); await expect( - generateIssuerKey(sql, NOW, { + generateIssuerKey(sql, secrets, NOW, { ...window, generateKeyPair: stuck.generate, maxKeyGenAttempts: 3, @@ -227,7 +233,7 @@ describe("generateIssuerKey truncated-id collision avoidance", () => { }; const [k1] = await distinctKeyPairs(1); const seed = scriptedGenerator([k1!]); - await generateIssuerKey(sql, NOW, { ...past, generateKeyPair: seed.generate }); + await generateIssuerKey(sql, secrets, NOW, { ...past, generateKeyPair: seed.generate }); // A disjoint future window sees no reserved bytes from the past key. const disjoint = await overlappingTruncatedKeyIds( @@ -275,11 +281,13 @@ describe("generateIssuerKey concurrent generation is serialized", () => { } const results = await Promise.all( - generators.map((generate) => generateIssuerKey(sql, NOW, { generateKeyPair: generate })), + generators.map((generate) => + generateIssuerKey(sql, secrets, NOW, { generateKeyPair: generate }), + ), ); expect(results).toHaveLength(N); - const keys = await loadActiveIssuerKeys(sql, NOW, DEFAULT_ISSUER_NAME); + const keys = await loadActiveIssuerKeys(sql, secrets, NOW, DEFAULT_ISSUER_NAME); expect(keys).toHaveLength(N); // The whole point: every overlapping stored key has a DISTINCT truncated byte, // so issuance can never be ambiguous. Without the advisory lock the three @@ -291,13 +299,13 @@ describe("generateIssuerKey concurrent generation is serialized", () => { describe("overlapping keys with distinct bytes issue + redeem correctly", () => { it("a token blinded against the OLDER of two overlapping keys still issues and redeems", async () => { await sql`TRUNCATE conditions.issuer_key`; - const older = await generateIssuerKey(sql, NOW, { + const older = await generateIssuerKey(sql, secrets, NOW, { notBefore: "2026-05-01T00:00:00.000Z", notAfter: "2026-08-01T00:00:00.000Z", }); - await generateIssuerKey(sql, NOW); + await generateIssuerKey(sql, secrets, NOW); - const keys = await loadActiveIssuerKeys(sql, NOW, DEFAULT_ISSUER_NAME); + const keys = await loadActiveIssuerKeys(sql, secrets, NOW, DEFAULT_ISSUER_NAME); expect(keys).toHaveLength(2); // The generation-time invariant: no two overlapping keys share a truncated byte. expect(new Set(keys.map((k) => k.truncatedTokenKeyId)).size).toBe(2); @@ -319,6 +327,7 @@ describe("overlapping keys with distinct bytes issue + redeem correctly", () => const request = await client.createTokenRequest(challenge, olderKey.publicKeyBytes); const result = await issueToken(sql, reporter.keyId, "2026-07-12", request.serialize(), ctx, { log: noopLog, + secrets, now: NOW, }); expect(result.issued).toBe(true); diff --git a/services/contributions-api/src/__tests__/observation-claims.integration.test.ts b/services/contributions-api/src/__tests__/observation-claims.integration.test.ts index bec34a1f0..1fa6e8779 100644 --- a/services/contributions-api/src/__tests__/observation-claims.integration.test.ts +++ b/services/contributions-api/src/__tests__/observation-claims.integration.test.ts @@ -8,15 +8,26 @@ import { signReport, signSubClaim, } from "@openconditions/contrib-core"; -import { buildRegistry, crowdLocalId, observationId } from "@openconditions/model"; +import { + admitRecord, + buildRegistry, + crowdLocalId, + observationId, + schemaVersions, +} from "@openconditions/model"; import { productionModules } from "@openconditions/model-registry"; import { ensureObservationPartitions, retentionClasses, + sweepRecords, syncSources, writeSnapshot, } from "@openconditions/storage"; -import { createTestDatabase, type TestDatabase } from "@openconditions/test-database"; +import { + createTestDatabase, + TEST_SECRETS_KEY, + type TestDatabase, +} from "@openconditions/test-database"; import type { FastifyInstance } from "fastify"; import type postgres from "postgres"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; @@ -24,7 +35,7 @@ import { checkReportRate } from "../abuse/rate.js"; import { createReportingGrant } from "../attester/grant.js"; import { sweepCrossValidateObservations } from "../evidence/crossValidateSweep.js"; import { build } from "../server.js"; -import { enrolledKey, INSTANCE } from "./crowd-fixtures.integration.js"; +import { enrolledKey, INSTANCE, landAs, situationClaim } from "./crowd-fixtures.integration.js"; type Rec = Record; @@ -39,6 +50,7 @@ const GRANT_SECRET_VALUE = "observation-claims-test-secret"; const GRANT_SECRET = new TextEncoder().encode(GRANT_SECRET_VALUE); const ENV = { OPENCONDITIONS_GRANT_SECRET: GRANT_SECRET_VALUE, + OPENCONDITIONS_SECRETS_KEY: TEST_SECRETS_KEY, OPENCONDITIONS_INSTANCE_ID: INSTANCE, }; const MODEL_TESTS = path.resolve( @@ -1166,3 +1178,155 @@ describe("crowd readings and the federation", () => { expect(n).toBe(0); }); }); + +describe("a deleted reporter's key", () => { + const liveSubject = { featureId: live.feature["id"] as string, componentKey: "262397002" }; + const registerSubject = { + featureId: register.feature["id"] as string, + componentKey: (register.feature["components"] as { key: string }[])[0]!.key, + }; + let situations = 0; + + beforeAll(async () => { + clock.now = "2026-10-02T09:00:00.000Z"; + // A peer subscribed to every class, so crowd situations are journalled. + await sql`INSERT INTO conditions.federation_subscription (id, peer_id, created_at, updated_at) + VALUES ('strip-sub', 'peer.example.net', now(), now())`; + }); + + afterAll(async () => { + await sql`DELETE FROM conditions.federation_subscription WHERE id = 'strip-sub'`; + }); + + /** A crowd reading of `subject` and a crowd situation, both by `key`. */ + async function reportsBy( + key: ReporterKey, + grant: string, + subject: Rec, + reportedAt: string, + ): Promise<{ reading: string; situation: string }> { + const res = await post( + await signReport(registry, claimOf({ subject, reportedAt }), key), + grant, + ); + expect(res.statusCode).toBe(200); + const landed = await landAs( + sql, + key, + situationClaim({ + geometry: { type: "Point", coordinates: [8.41 + 0.01 * ++situations, 49.01] }, + reportedAt, + nonce: nextNonce(), + }), + clock.now, + ); + return { + reading: (res.json() as { record: { id: string } }).record.id, + situation: landed.record.id, + }; + } + + /** How many rows of each table that can hold a reporter's key name `key`. */ + async function rowsNaming(key: string) { + const like = `%${key}%`; + const [row] = await sql< + { readings: number; situations: number; revisions: number; journal: number }[] + >` + SELECT + (SELECT count(*)::int FROM conditions.observation_latest + WHERE reading::text LIKE ${like} OR template::text LIKE ${like}) AS readings, + (SELECT count(*)::int FROM conditions.situation WHERE record::text LIKE ${like}) + AS situations, + (SELECT count(*)::int FROM conditions.situation_revision WHERE snapshot::text LIKE ${like}) + AS revisions, + (SELECT count(*)::int FROM conditions.federation_outbox WHERE snapshot::text LIKE ${like}) + AS journal`; + return row!; + } + + const readingOf = async (id: string) => { + const [row] = await sql<{ reading: Rec; record: Rec }[]>` + SELECT reading, conditions.observation_record(template, reading) AS record + FROM conditions.observation_latest WHERE crowd_record_id = ${id}`; + return row!; + }; + const situationOf = async (id: string) => { + const [row] = await sql<{ record: Rec }[]>` + SELECT record FROM conditions.situation WHERE id = ${id}`; + return row!.record; + }; + const withoutReporter = (value: Rec): Rec => { + const { reporter: _reporter, ...provenance } = value["provenance"] as Rec; + return { ...value, provenance }; + }; + + /** Deletes `gone` by `erase` and checks its key went and `kept`'s stayed. */ + async function expectStripped( + gone: ReporterKey, + kept: ReporterKey, + landed: { reading: string; situation: string }, + erase: () => Promise, + ) { + const everywhere = { readings: 1, situations: 1, revisions: 1, journal: 1 }; + for (const [table, n] of Object.entries(await rowsNaming(gone.keyId))) { + expect(n, table).toBeGreaterThanOrEqual(everywhere[table as keyof typeof everywhere]); + } + const readingBefore = await readingOf(landed.reading); + const situationBefore = await situationOf(landed.situation); + const keptBefore = await rowsNaming(kept.keyId); + + await erase(); + + expect(await rowsNaming(gone.keyId)).toEqual({ + readings: 0, + situations: 0, + revisions: 0, + journal: 0, + }); + expect(await rowsNaming(kept.keyId)).toEqual(keptBefore); + // Only the reporter went: the reading and the situation are otherwise + // unchanged, read back whole and are still records the model accepts. + const reading = await readingOf(landed.reading); + expect(reading.reading).toEqual(withoutReporter(readingBefore.reading)); + expect(reading.record).toEqual(withoutReporter(readingBefore.record)); + const situation = await situationOf(landed.situation); + expect(situation).toEqual(withoutReporter(situationBefore)); + const versions = schemaVersions(registry); + expect(admitRecord(registry, versions, reading.record)).toMatchObject({ admitted: true }); + expect(admitRecord(registry, versions, situation)).toMatchObject({ admitted: true }); + } + + it("is removed from what it reported when the reporter row is deleted by hand", async () => { + const [gone, kept] = [await reporter(), await reporter()]; + const landed = await reportsBy(gone.key, gone.grant, liveSubject, "2026-10-02T08:58:00.000Z"); + await reportsBy(kept.key, kept.grant, registerSubject, "2026-10-02T08:58:00.000Z"); + + await expectStripped(gone.key, kept.key, landed, async () => { + await sql`DELETE FROM conditions.reporter WHERE key_id = ${gone.key.keyId}`; + }); + }, 60_000); + + it("is removed from what it reported when the sweep deletes an inactive reporter", async () => { + const [gone, kept] = [await reporter(), await reporter()]; + const landed = await reportsBy(gone.key, gone.grant, liveSubject, "2026-10-02T08:59:00.000Z"); + await reportsBy(kept.key, kept.grant, registerSubject, "2026-10-02T08:59:00.000Z"); + await sql`UPDATE conditions.reporter + SET last_active_at = '2025-09-01T00:00:00Z', entitlement_expires_at = '2025-09-02T00:00:00Z' + WHERE key_id = ${gone.key.keyId}`; + // The feeds count as polling, so the sweep ends none of their records. + await sql`INSERT INTO conditions.source_status (source, last_success_at, freshness_window_sec) + VALUES ('de-bw-mobidata-charging', ${clock.now}, 900), ('es-minetur-fuel', ${clock.now}, 900) + ON CONFLICT (source) DO UPDATE SET last_success_at = EXCLUDED.last_success_at`; + + await expectStripped(gone.key, kept.key, landed, async () => { + const counts = await sweepRecords(sql, { + registry, + instanceId: INSTANCE, + now: clock.now, + maxAgeSec: 3600, + historyDays: 7, + }); + expect(counts).toMatchObject({ reporters: 1, busy: 0 }); + }); + }, 60_000); +}); diff --git a/services/contributions-api/src/__tests__/reports.integration.test.ts b/services/contributions-api/src/__tests__/reports.integration.test.ts index 722ae9e15..2e20a267d 100644 --- a/services/contributions-api/src/__tests__/reports.integration.test.ts +++ b/services/contributions-api/src/__tests__/reports.integration.test.ts @@ -13,7 +13,11 @@ import { type RegistryModule, } from "@openconditions/model"; import { productionModules } from "@openconditions/model-registry"; -import { createTestDatabase, type TestDatabase } from "@openconditions/test-database"; +import { + createTestDatabase, + TEST_SECRETS_KEY, + type TestDatabase, +} from "@openconditions/test-database"; import type { FastifyInstance } from "fastify"; import type postgres from "postgres"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; @@ -34,6 +38,7 @@ const GRANT_SECRET_VALUE = "reports-route-test-secret"; const GRANT_SECRET = new TextEncoder().encode(GRANT_SECRET_VALUE); const ENV = { OPENCONDITIONS_GRANT_SECRET: GRANT_SECRET_VALUE, + OPENCONDITIONS_SECRETS_KEY: TEST_SECRETS_KEY, OPENCONDITIONS_INSTANCE_ID: INSTANCE, }; /** An obstruction's crowd lifetime: the default claim's. */ diff --git a/services/contributions-api/src/__tests__/reviewer.integration.test.ts b/services/contributions-api/src/__tests__/reviewer.integration.test.ts index 7895704ba..baa665572 100644 --- a/services/contributions-api/src/__tests__/reviewer.integration.test.ts +++ b/services/contributions-api/src/__tests__/reviewer.integration.test.ts @@ -6,7 +6,11 @@ import { type SubClaimType, signSubClaim, } from "@openconditions/contrib-core"; -import { createTestDatabase, type TestDatabase } from "@openconditions/test-database"; +import { + createTestDatabase, + TEST_SECRETS_KEY, + type TestDatabase, +} from "@openconditions/test-database"; import type { FastifyInstance } from "fastify"; import type postgres from "postgres"; import { afterAll, beforeAll, beforeEach, describe, expect, it } from "vitest"; @@ -26,6 +30,7 @@ const GRANT_SECRET_VALUE = "reviewer-route-test-grant-secret"; const REVIEWER_TOKEN = "reviewer-route-test-operator-token"; const ENV = { OPENCONDITIONS_GRANT_SECRET: GRANT_SECRET_VALUE, + OPENCONDITIONS_SECRETS_KEY: TEST_SECRETS_KEY, OPENCONDITIONS_REVIEWER_TOKEN: REVIEWER_TOKEN, OPENCONDITIONS_INSTANCE_ID: INSTANCE, }; @@ -279,7 +284,7 @@ async function fetchFlaggedItem(id: string): Promise i.record.id === id); } -describe("migration 0012 — conditions.block_list", () => { +describe("conditions.block_list", () => { it("creates the block_list table with the expected columns", async () => { const cols = await sql<{ column_name: string; is_nullable: string }[]>` SELECT column_name, is_nullable FROM information_schema.columns @@ -320,6 +325,7 @@ describe("reviewer auth — operator bearer token", () => { env: { NODE_ENV: "production", OPENCONDITIONS_GRANT_SECRET: GRANT_SECRET_VALUE, + OPENCONDITIONS_SECRETS_KEY: TEST_SECRETS_KEY, OPENCONDITIONS_INSTANCE_ID: INSTANCE, }, logger: false, diff --git a/services/contributions-api/src/__tests__/role-grants.integration.test.ts b/services/contributions-api/src/__tests__/role-grants.integration.test.ts new file mode 100644 index 000000000..d17d0a8bf --- /dev/null +++ b/services/contributions-api/src/__tests__/role-grants.integration.test.ts @@ -0,0 +1,614 @@ +import { readFileSync } from "node:fs"; +import path from "node:path"; +import { publicVerif } from "@cloudflare/privacypass-ts"; +import { + generateReporterKey, + type ReporterKey, + type SituationClaim, + type SubClaimType, + signReport, + signSubClaim, +} from "@openconditions/contrib-core"; +import { + assertStoredCodesRegistered, + runMigrations, + waitForSchemaVersion, +} from "@openconditions/core/server"; +import type { Registry } from "@openconditions/model"; +import { observationId } from "@openconditions/model"; +import { + ensureObservationPartitions, + retentionClasses, + syncSources, + writeSnapshot, +} from "@openconditions/storage"; +import { + contributionsRoleUrl, + createTestDatabase, + TEST_SECRETS_KEY, + type TestDatabase, +} from "@openconditions/test-database"; +import type { FastifyInstance } from "fastify"; +import postgres from "postgres"; +import { afterAll, beforeAll, describe, expect, it } from "vitest"; +import { autoCorroborateOnLanding } from "../evidence/autoCorroborate.js"; +import { crossValidateAgainstFeeds } from "../evidence/crossValidate.js"; +import { crossValidateObservation } from "../evidence/crossValidateObservation.js"; +import { + sweepCrossValidate, + sweepCrossValidateObservations, + sweepFederatedCrossValidate, +} from "../evidence/crossValidateSweep.js"; +import { type PublicContext, redemptionContext, reportEpoch } from "../issuer/context.js"; +import { DEFAULT_ISSUER_NAME } from "../issuer/keys.js"; +import { flagOntoOpenFlagged } from "../reviewer/streetcomplete.js"; +import { build } from "../server.js"; +import { + INSTANCE, + registry, + reportAs, + seedFeedSituation, + seedPeerCrowdReport, + situationClaim, +} from "./crowd-fixtures.integration.js"; + +/** + * The contributions service's flows, run as its own role holding only what + * the custom migration grants it: boot, enrollment, tokens, crowd reports on + * situations and readings, votes, the reviewer's decisions and block list, + * and the cross-validation sweeps. A privilege the migration does not grant + * fails the flow that needs it. Fixtures are written as the ingest service + * writes them, by the schema's owner. The cases build on one another and run + * in order. + */ + +type Rec = Record; +const { BlindRSAMode, Client, Origin, TokenResponse } = publicVerif; + +const GRANT_SECRET_VALUE = "role-grants-test-grant-secret"; +const REVIEWER_TOKEN = "role-grants-test-reviewer-token"; +const ENV = { + OPENCONDITIONS_GRANT_SECRET: GRANT_SECRET_VALUE, + OPENCONDITIONS_SECRETS_KEY: TEST_SECRETS_KEY, + OPENCONDITIONS_REVIEWER_TOKEN: REVIEWER_TOKEN, + OPENCONDITIONS_INSTANCE_ID: INSTANCE, +}; +const MODEL_TESTS = path.resolve( + import.meta.dirname, + "../../../../packages/model-registry/src/__tests__", +); + +interface OcpdbLocation { + id: string; + coordinates: { latitude: number; longitude: number }; + evses: { uid: string; status: string }[]; +} + +/** A charging site and its charge points' statuses, as the charging feed writes them. */ +function chargingSite(loc: OcpdbLocation, fetchedAt: string) { + const id = `oc:feature:de-bw-mobidata-charging:${loc.id}`; + const provenance = { + origin: "feed", + sourceId: "de-bw-mobidata-charging", + sourceFormat: "ocpi", + accessMode: "bulk", + recordId: loc.id, + attribution: { provider: "MobiData BW", license: "CC-BY-4.0" }, + privacy: { class: "authoritative" }, + }; + const location = { + geometry: { type: "Point", coordinates: [loc.coordinates.longitude, loc.coordinates.latitude] }, + extent: "point", + geometryOrigin: "source", + fuzziness: "exact", + }; + const feature: Rec = { + id, + class: "feature", + kind: "charging_site", + temporality: "static", + lifecycle: "operational", + location, + externalIds: [{ scheme: "provider", id: loc.id, authority: "de-bw-mobidata-charging/ocpdb" }], + provenance, + freshness: { fetchedAt }, + components: loc.evses.map((evse) => ({ + key: evse.uid, + kind: "evse", + details: { kind: "evse", v: 1, uid: evse.uid }, + })), + details: { kind: "charging_site", v: 1 }, + }; + const statuses = loc.evses + .filter((evse) => evse.status !== "STATIC") + .map((evse) => { + const draft: Rec = { + class: "observation", + kind: "observation", + property: "charging.evse_status", + temporality: "live", + location, + provenance, + freshness: { fetchedAt }, + subject: { kind: "feature", featureId: id, componentKey: evse.uid }, + result: { + type: "category", + value: registry.crosswalk.value("evse_status", "ocpi", evse.status) ?? "unknown", + vocabulary: "evse_status", + }, + phenomenonTime: { instant: fetchedAt }, + aggregation: "instantaneous", + }; + return { id: observationId("de-bw-mobidata-charging", draft as never), ...draft }; + }); + return { feature, statuses }; +} + +/** One site with live charge points, and a register's site of the same points without a state. */ +const [site, register] = ( + JSON.parse( + readFileSync(path.join(MODEL_TESTS, "fixtures/crowd/ocpdb-luisenstrasse-2f.json"), "utf8"), + ).items as OcpdbLocation[] +).map((l) => chargingSite(l, "2026-10-01T06:40:00.000Z")) as [ + ReturnType, + ReturnType, +]; +const chargePoints = (site.feature["components"] as { key: string }[]).map((c) => c.key); + +/** The ministry's fuel stations and prices (MINETUR, CC BY 4.0), as sealed golden records. */ +const fuel = ( + JSON.parse(readFileSync(path.join(MODEL_TESTS, "golden/facilities.json"), "utf8")) as Rec[] +).filter((r) => (r["provenance"] as Rec)["sourceId"] === "es-minetur-fuel"); +const station = fuel.find((r) => r["id"] === "oc:feature:es-minetur-fuel:3119")!; +const e5 = fuel.find( + (r) => + r["class"] === "observation" && + (r["subject"] as Rec)["componentKey"] === "e5" && + (r["subject"] as Rec)["featureId"] === station["id"], +)!; + +/** The draft a sealed golden record was made from. */ +function draftOf(sealed: Rec): Rec { + const { + canonicalId: _c, + domain: _d, + revision: _r, + recordedAt: _t, + contentHash: _h, + ...draft + } = sealed; + const { instanceId: _i, ...provenance } = draft["provenance"] as Rec; + return { ...draft, provenance }; +} + +const clock = { now: "2026-07-12T08:00:00.000Z" }; +let db: TestDatabase; +let contributions: postgres.Sql; +let app: FastifyInstance; +/** Errors of the landing hooks, which the routes log and swallow. */ +const hookErrors: unknown[] = []; + +/** The sweeps log a candidate that failed and go on; these are those lines. */ +const sweepFailures: string[] = []; +const sweepLog = { + log: (message: string) => { + if (message.includes(" failed: ")) sweepFailures.push(message); + }, +}; + +/** A landing hook that records its error before the route swallows it. */ +function surfaced( + hook: (sql: postgres.Sql, registry: Registry, id: string, now: string) => Promise, +) { + return async (sql: postgres.Sql, reg: Registry, id: string, now: string): Promise => { + try { + return await hook(sql, reg, id, now); + } catch (err) { + hookErrors.push(err); + throw err; + } + }; +} + +beforeAll(async () => { + // The roles exist before the first migrate, as on an OpenMapX install. + db = await createTestDatabase({ empty: true, pool: { max: 4 } }); + await runMigrations(db.url); + const owner = db.sql; + await syncSources( + owner, + ["de-autobahn-events", "de-bw-mobidata-charging", "es-minetur-fuel"].map((id) => ({ + id, + domain: id === "de-autobahn-events" ? "traffic" : "facilities", + format: "test", + product: id === "de-autobahn-events" ? "events" : "facilities", + tier: "authoritative", + country: "DE", + operator: id, + license: "CC-BY-4.0", + attribution: id, + restricted: false, + cadenceSec: 300, + freshnessWindowSec: 900, + })), + ); + // A peer subscribed to every class, so the capture triggers journal. + await owner` + INSERT INTO conditions.federation_subscription (id, peer_id, created_at, updated_at) + VALUES ('sub-1', 'peer.example.net', now(), now())`; + await seedFeedSituation(owner, "feed-1"); + await seedPeerCrowdReport(owner, "peer-1", [8.7, 49.2]); + await ensureObservationPartitions(owner, { + classes: retentionClasses(registry), + now: new Date("2026-09-22T00:00:00.000Z"), + }); + const summary = await writeSnapshot( + owner, + "de-bw-mobidata-charging", + { + features: [site.feature, register.feature], + observations: [...site.statuses, ...register.statuses], + }, + { registry, instanceId: INSTANCE, complete: true, now: "2026-10-01T06:40:00.000Z" }, + ); + expect(summary.rejected).toEqual([]); + const prices = await writeSnapshot( + owner, + "es-minetur-fuel", + { + features: fuel.filter((r) => r["class"] === "feature").map(draftOf), + observations: fuel.filter((r) => r["class"] === "observation").map(draftOf), + }, + { registry, instanceId: INSTANCE, complete: true, now: "2026-09-22T11:10:00.000Z" }, + ); + expect(prices.rejected).toEqual([]); + + // The service's boot, as main.ts runs it. + contributions = postgres(contributionsRoleUrl(db), { max: 5, onnotice: () => {} }); + await waitForSchemaVersion(contributions, { timeoutMs: 5_000 }); + await assertStoredCodesRegistered(contributions, registry, { sourceFormats: false }); + app = await build({ + sql: contributions, + registry, + env: ENV, + logger: false, + now: () => clock.now, + streetCompleteCheck: surfaced(flagOntoOpenFlagged), + autoCorroborate: surfaced(autoCorroborateOnLanding), + crossValidateAgainstFeeds: surfaced(crossValidateAgainstFeeds), + crossValidateObservation: surfaced(crossValidateObservation), + }); +}, 180_000); + +afterAll(async () => { + await app?.close(); + await contributions?.end(); + await db?.close(); +}, 30_000); + +let ips = 0; +let nonces = 0; +const nextNonce = () => `grant-nonce-${String(++nonces).padStart(8, "0")}`; + +async function enroll(key: ReporterKey): Promise { + const res = await app.inject({ + method: "POST", + url: "/contrib/enroll", + payload: { pubJwk: key.publicJwk, proof: { keyId: key.keyId, accountAgeDays: 30 } }, + remoteAddress: `198.51.100.${++ips}`, + }); + return (ok(res).json() as { reportingGrant: string }).reportingGrant; +} + +/** Expects a 200 and shows the body otherwise, where a refused privilege surfaces as a 500. */ +function ok(res: T): T { + expect(res.statusCode, res.body).toBe(200); + return res; +} + +async function reporter(): Promise<{ key: ReporterKey; grant: string }> { + const key = await generateReporterKey(); + return { key, grant: await enroll(key) }; +} + +async function report( + who: { key: ReporterKey; grant: string }, + over: Partial, +): Promise<{ statusCode: number; body: string; id?: string }> { + const signed = await reportAs( + who.key, + situationClaim({ reportedAt: clock.now, nonce: nextNonce(), ...over }), + ); + const res = await app.inject({ + method: "POST", + url: "/contrib/reports", + payload: { report: signed, reportingGrant: who.grant }, + }); + return { + statusCode: res.statusCode, + body: res.body, + id: res.statusCode === 200 ? (res.json() as { record: { id: string } }).record.id : undefined, + }; +} + +async function vote( + who: { key: ReporterKey; grant: string }, + recordClass: "situation" | "observation", + id: string, + action: SubClaimType, +) { + const subClaim = await signSubClaim( + { + subject: { class: recordClass, id }, + claimType: action, + reportedAt: clock.now, + nonce: nextNonce(), + }, + who.key, + ); + return app.inject({ + method: "POST", + url: `/contrib/reports/${recordClass}/${encodeURIComponent(id)}/${action}`, + payload: { subClaim, reportingGrant: who.grant }, + }); +} + +function asReviewer(method: "GET" | "POST" | "DELETE", url: string, payload?: unknown) { + return app.inject({ + method, + url, + headers: { authorization: `Bearer ${REVIEWER_TOKEN}` }, + ...(payload === undefined ? {} : { payload: payload as Rec }), + }); +} + +const point = (lon: number, lat: number): SituationClaim["geometry"] => ({ + type: "Point", + coordinates: [lon, lat], +}); + +describe("the contributions service as its own role", () => { + it("serves its issuer keys", async () => { + const res = ok(await app.inject({ method: "GET", url: "/contrib/issuer-keys" })); + expect((res.json() as { keys: unknown[] }).keys.length).toBeGreaterThan(0); + }); + + it("enrolls a reporter, issues and redeems a token, and reports its standing", async () => { + const { grant } = await reporter(); + const keys = await app.inject({ method: "GET", url: "/contrib/issuer-keys" }); + const [issuerKey] = (keys.json() as { keys: { publicKey: string }[] }).keys; + const ctx: PublicContext = { purpose: "report", epoch: reportEpoch(clock.now) }; + const client = new Client(BlindRSAMode.PSS); + const challenge = new Origin(BlindRSAMode.PSS).createTokenChallenge( + DEFAULT_ISSUER_NAME, + await redemptionContext(ctx), + ); + const request = await client.createTokenRequest( + challenge, + new Uint8Array(Buffer.from(issuerKey!.publicKey, "base64url")), + ); + const issued = ok( + await app.inject({ + method: "POST", + url: "/contrib/tokens", + payload: { + reportingGrant: grant, + blindedRequest: Buffer.from(request.serialize()).toString("base64url"), + }, + }), + ); + const token = await client.finalize( + TokenResponse.deserialize( + new Uint8Array(Buffer.from((issued.json() as { token: string }).token, "base64url")), + ), + ); + expect(await app.tokenVerifier.verify(contributions, token.serialize(), ctx, clock.now)).toBe( + true, + ); + expect(await app.tokenVerifier.verify(contributions, token.serialize(), ctx, clock.now)).toBe( + false, + ); + ok( + await app.inject({ + method: "GET", + url: "/contrib/reporter/me", + headers: { authorization: `Bearer ${grant}` }, + }), + ); + }, 60_000); + + it("lands crowd situations, corroborates them and cross-validates one against a feed", async () => { + // Where the feed's obstruction is: cross-validated against it. + ok(await report(await reporter(), { geometry: point(8.4, 49) })); + // Two independent reports of one phenomenon corroborate each other. + ok(await report(await reporter(), { geometry: point(9.0, 44.0) })); + ok(await report(await reporter(), { geometry: point(9.0, 44.0) })); + // A report the landing refuses counts against its reporter's rate. + const stale = await report(await reporter(), { + geometry: point(9.5, 44.5), + reportedAt: new Date(Date.parse(clock.now) - 36 * 3_600_000).toISOString(), + }); + expect(stale.statusCode, stale.body).toBe(422); + // A report of closed lanes carries its effect. + ok( + await report(await reporter(), { + geometry: point(12.0, 47.0), + effects: [ + { + id: "lanes", + kind: "lane_restriction", + v: 1, + vehicleImpact: "some_lanes_closed", + applicability: { kind: "all" }, + compliance: "mandatory", + normalization: "complete", + }, + ], + } as Partial), + ); + expect(hookErrors).toEqual([]); + const [journalled] = await db.sql<{ n: number }[]>` + SELECT count(*)::int AS n FROM conditions.federation_outbox WHERE record_class = 'situation'`; + expect(journalled!.n).toBeGreaterThan(0); + }, 60_000); + + it("takes votes on a situation, and the reviewer's decisions on flagged ones", async () => { + const id = ok(await report(await reporter(), { geometry: point(10.0, 45.0) })).id!; + ok(await vote(await reporter(), "situation", id, "confirm")); + ok(await vote(await reporter(), "situation", id, "negate")); + ok(await vote(await reporter(), "situation", id, "flag")); + // A report landing onto the open-flagged phenomenon is flagged too. + ok(await report(await reporter(), { geometry: point(10.0, 45.0) })); + const queue = ok(await asReviewer("GET", "/contrib/reviewer/flagged")); + expect(queue.body).toContain(id); + ok(await asReviewer("POST", `/contrib/reviewer/situation/${encodeURIComponent(id)}/accept`)); + + const rejectedId = ok(await report(await reporter(), { geometry: point(11.0, 46.0) })).id!; + ok(await vote(await reporter(), "situation", rejectedId, "flag")); + const rejected = ok( + await asReviewer( + "POST", + `/contrib/reviewer/situation/${encodeURIComponent(rejectedId)}/reject`, + ), + ); + expect((rejected.json() as { tombstoned: boolean }).tombstoned).toBe(true); + expect(hookErrors).toEqual([]); + }, 60_000); + + it("blocks and unblocks a reporter", async () => { + const { key } = await reporter(); + ok(await asReviewer("POST", "/contrib/reviewer/blocklist", { keyId: key.keyId, reason: "x" })); + // Blocking again replaces the reason. + ok(await asReviewer("POST", "/contrib/reviewer/blocklist", { keyId: key.keyId, reason: "y" })); + expect(ok(await asReviewer("GET", "/contrib/reviewer/blocklist")).body).toContain(key.keyId); + ok(await asReviewer("DELETE", `/contrib/reviewer/blocklist/${key.keyId}`)); + }); + + it("lands crowd fuel prices and checks one against a later feed price", async () => { + clock.now = "2026-09-22T12:01:00.000Z"; + const published = Number((e5["result"] as { amount: string }).amount); + const price = async (delta: number, reportedAt: string) => { + const who = await reporter(); + const claim = { + claimClass: "observation", + property: "fuel.price", + subject: { featureId: station["id"], componentKey: "e5" }, + result: { + type: "money", + amount: (published + delta).toFixed(3), + currency: "EUR", + per: "L", + }, + geometry: (station["location"] as { geometry: unknown }).geometry, + reportedAt, + nonce: nextNonce(), + } as never; + return app.inject({ + method: "POST", + url: "/contrib/reports", + payload: { report: await signReport(registry, claim, who.key), reportingGrant: who.grant }, + }); + }; + // Within a cent of the ministry's price: resolved as it lands. + ok(await price(0.009, "2026-09-22T12:00:00.000Z")); + ok(await price(0.02, "2026-09-22T12:00:30.000Z")); + // The ministry publishes a later price: the sweep reads the series' history table. + const repriced: Rec = { + ...draftOf(e5), + result: { ...(e5["result"] as Rec), amount: (published + 0.02).toFixed(3) }, + phenomenonTime: { instant: "2026-09-22T12:05:00.000Z" }, + freshness: { fetchedAt: "2026-09-22T12:06:00.000Z" }, + }; + const { id: _old, ...later } = repriced; + const summary = await writeSnapshot( + db.sql, + "es-minetur-fuel", + { observations: [{ ...later, id: observationId("es-minetur-fuel", later as never) }] }, + { registry, instanceId: INSTANCE, now: "2026-09-22T12:06:00.000Z", complete: false }, + ); + expect(summary.rejected).toEqual([]); + clock.now = "2026-09-22T12:07:00.000Z"; + const swept = await sweepCrossValidateObservations( + contributions, + registry, + clock.now, + sweepLog, + ); + expect(swept.scanned).toBeGreaterThan(0); + expect(sweepFailures).toEqual([]); + expect(hookErrors).toEqual([]); + }, 60_000); + + it("lands crowd readings of a charge point, confirms them and takes votes", async () => { + clock.now = "2026-10-01T07:00:00.000Z"; + const claim = ( + componentKey: string, + value: string, + reportedAt: string, + featureId = site.feature["id"], + ) => + ({ + claimClass: "observation", + property: "charging.evse_status", + result: { type: "category", value, vocabulary: "evse_status" }, + geometry: { type: "Point", coordinates: [8.40478, 49.00062] }, + subject: { featureId, componentKey }, + reportedAt, + nonce: nextNonce(), + }) as never; + const post = async (who: { key: ReporterKey; grant: string }, body: never) => + app.inject({ + method: "POST", + url: "/contrib/reports", + payload: { report: await signReport(registry, body, who.key), reportingGrant: who.grant }, + }); + const at = "2026-10-01T06:59:00.000Z"; + const first = ok(await post(await reporter(), claim(chargePoints[0]!, "out_of_order", at))); + const id = (first.json() as { record: { id: string } }).record.id; + // The same reading from a second driver confirms it. + ok(await post(await reporter(), claim(chargePoints[0]!, "out_of_order", at))); + ok(await vote(await reporter(), "observation", id, "confirm")); + ok(await vote(await reporter(), "observation", id, "flag")); + + // A charge point only the register lists has no feed reading: a driver's + // report is its fused row's only source, and the row goes once drivers negate it. + const listed = (register.feature["components"] as { key: string }[])[0]!.key; + const lone = ok( + await post(await reporter(), claim(listed, "out_of_order", at, register.feature["id"])), + ); + const loneId = (lone.json() as { record: { id: string } }).record.id; + const fused = async () => { + const [row] = await db.sql<{ n: number }[]>` + SELECT count(*)::int AS n FROM conditions.observation_latest + WHERE source_id = '@fused' AND ${loneId} = ANY(fused_from)`; + return row!.n; + }; + expect(await fused()).toBe(1); + // Negated, the reading has ended and takes no more votes. + for (let votes = 0; (await fused()) > 0 && votes < 5; votes++) { + ok(await vote(await reporter(), "observation", loneId, "negate")); + } + expect(await fused()).toBe(0); + expect(hookErrors).toEqual([]); + }, 60_000); + + it("runs the cross-validation sweeps", async () => { + clock.now = "2026-07-12T08:05:00.000Z"; + const local = await sweepCrossValidate(contributions, registry, clock.now, sweepLog); + const federated = await sweepFederatedCrossValidate( + contributions, + registry, + clock.now, + sweepLog, + ); + clock.now = "2026-10-01T07:05:00.000Z"; + const readings = await sweepCrossValidateObservations( + contributions, + registry, + clock.now, + sweepLog, + ); + expect([local.scanned, federated.scanned, readings.scanned]).not.toContain(0); + expect(sweepFailures).toEqual([]); + }, 60_000); +}); diff --git a/services/contributions-api/src/__tests__/schema-version.integration.test.ts b/services/contributions-api/src/__tests__/schema-version.integration.test.ts new file mode 100644 index 000000000..fc279dae0 --- /dev/null +++ b/services/contributions-api/src/__tests__/schema-version.integration.test.ts @@ -0,0 +1,168 @@ +import { + expectedSchemaVersion, + runMigrations, + waitForSchemaVersion, +} from "@openconditions/core/server"; +import { + contributionsRoleUrl, + createTestDatabase, + createTestRole, + type TestDatabase, + type TestRole, +} from "@openconditions/test-database"; +import postgres from "postgres"; +import { afterEach, describe, expect, it, vi } from "vitest"; + +/** + * The contributions service migrates nothing: at boot it waits until the + * ingest service has brought the schema to this build's version, reading the + * migration history with its own role, which has no DDL rights. The custom + * migration grants that role the read; a role it does not know gets none. + */ + +const expected = expectedSchemaVersion(); + +/** Closed after each test in this order: the role's clients, the databases, then the roles. */ +const clients: postgres.Sql[] = []; +const databases: TestDatabase[] = []; +const roles: TestRole[] = []; + +afterEach(async () => { + for (const client of clients.splice(0)) await client.end(); + for (const db of databases.splice(0)) await db.close(); + for (const role of roles.splice(0)) await role.drop(); +}); + +async function database(options: { empty?: boolean } = {}): Promise { + const db = await createTestDatabase(options); + databases.push(db); + return db; +} + +function connect(url: string): postgres.Sql { + const sql = postgres(url, { max: 1, onnotice: () => {} }); + clients.push(sql); + return sql; +} + +/** A database the ingest service migrated while the contributions role existed. */ +async function migrated(): Promise { + const db = await database({ empty: true }); + await runMigrations(db.url); + return db; +} + +/** The contributions service's own role, with the grants the migration gave it. */ +function asContributions(db: TestDatabase): postgres.Sql { + return connect(contributionsRoleUrl(db)); +} + +/** A role the migration grants nothing, with a connection to `db`. */ +async function ungranted(db: TestDatabase): Promise { + const role = await createTestRole(db); + roles.push(role); + return connect(role.url); +} + +describe("waitForSchemaVersion", () => { + it("lets the service start without DDL rights once the ingest service migrated", async () => { + const sql = asContributions(await migrated()); + + await expect(sql`CREATE TABLE conditions.probe (id int)`).rejects.toMatchObject({ + code: "42501", + }); + await expect(sql`CREATE SCHEMA probe`).rejects.toMatchObject({ code: "42501" }); + await expect(waitForSchemaVersion(sql, { timeoutMs: 5_000 })).resolves.toBeUndefined(); + }, 60_000); + + it("waits while the ingest service migrates, then resolves", async () => { + const db = await database({ empty: true }); + const sql = asContributions(db); + const told: string[] = []; + const waiting = waitForSchemaVersion(sql, { + timeoutMs: 60_000, + pollMs: 100, + onWait: (found) => told.push(found), + }); + await vi.waitFor(() => expect(told).toHaveLength(1), { timeout: 10_000 }); + await runMigrations(db.url); + await expect(waiting).resolves.toBeUndefined(); + // The schema exists a moment before the migration that grants the read commits. + expect(told[0]).toBe("conditions.__drizzle_migrations does not exist"); + for (const later of told.slice(1)) expect(later).toMatch(/cannot be read by this role/); + }, 60_000); + + it("tells again when what it finds changes", async () => { + const db = await database({ empty: true }); + const sql = await ungranted(db); + const told: string[] = []; + const waiting = waitForSchemaVersion(sql, { + timeoutMs: 10_000, + pollMs: 100, + onWait: (found) => told.push(found), + }); + const settled = waiting.catch((error: unknown) => error); + await vi.waitFor(() => expect(told).toHaveLength(1), { timeout: 5_000 }); + // The history appears, but this role was given no read of it. + await db.sql`CREATE SCHEMA conditions`; + await db.sql`CREATE TABLE conditions.__drizzle_migrations + (id serial PRIMARY KEY, hash text NOT NULL, created_at bigint)`; + await vi.waitFor(() => expect(told).toHaveLength(2), { timeout: 5_000 }); + expect(told).toEqual([ + "conditions.__drizzle_migrations does not exist", + expect.stringMatching( + /^conditions\.__drizzle_migrations cannot be read by this role \(permission denied for schema conditions\)/, + ), + ]); + expect(await settled).toBeInstanceOf(Error); + }, 30_000); + + it("fails clearly when the ingest service has not migrated", async () => { + const sql = asContributions(await database({ empty: true })); + await expect(waitForSchemaVersion(sql, { timeoutMs: 300, pollMs: 100 })).rejects.toThrow( + `the database schema did not reach this build's version within 300 ms: expected a migration in conditions.__drizzle_migrations with when ${expected.when} (${expected.tag}) or later, but conditions.__drizzle_migrations does not exist.`, + ); + }); + + it("fails clearly when the schema is older than this build", async () => { + const db = await migrated(); + const sql = asContributions(db); + await db.sql`DELETE FROM conditions.__drizzle_migrations WHERE created_at = ${expected.when}`; + const [older] = await db.sql<{ when: string }[]>` + SELECT max(created_at)::text AS when FROM conditions.__drizzle_migrations`; + expect(Number(older!.when)).toBeLessThan(expected.when); + await expect(waitForSchemaVersion(sql, { timeoutMs: 300, pollMs: 100 })).rejects.toThrow( + `but the latest recorded migration has when ${older!.when}.`, + ); + }, 60_000); + + it("fails clearly when the role may not read the history", async () => { + const sql = await ungranted(await database()); + await expect(waitForSchemaVersion(sql, { timeoutMs: 300, pollMs: 100 })).rejects.toThrow( + /conditions\.__drizzle_migrations cannot be read by this role \(permission denied for schema conditions\); it needs USAGE on the schema conditions and SELECT on the table.*A role created after the ingest service last started gets its grants when the ingest service restarts: restart it, and check that this role exists/, + ); + }); + + it("ends the wait at once on any other database error", async () => { + const db = await database({ empty: true }); + // A history table drizzle did not make: it has no created_at. + await db.sql`CREATE SCHEMA conditions`; + await db.sql`CREATE TABLE conditions.__drizzle_migrations (id serial PRIMARY KEY, hash text)`; + const started = Date.now(); + await expect( + waitForSchemaVersion(db.sql, { timeoutMs: 60_000, pollMs: 100 }), + ).rejects.toMatchObject({ code: "42703" }); + expect(Date.now() - started).toBeLessThan(5_000); + }); + + it("is not blocked by a newer ingest that applied later migrations", async () => { + const db = await migrated(); + const sql = asContributions(db); + // What a later release's ingest records for a migration this build does not ship. + await db.sql`INSERT INTO conditions.__drizzle_migrations (hash, created_at) + VALUES ('later', ${expected.when + 86_400_000})`; + await expect( + waitForSchemaVersion(sql, { timeoutMs: 300, pollMs: 100 }), + ).resolves.toBeUndefined(); + }, 60_000); +}); diff --git a/services/contributions-api/src/__tests__/schema.integration.test.ts b/services/contributions-api/src/__tests__/schema.integration.test.ts index b7f8a0840..182cede09 100644 --- a/services/contributions-api/src/__tests__/schema.integration.test.ts +++ b/services/contributions-api/src/__tests__/schema.integration.test.ts @@ -38,43 +38,61 @@ describe("contribution tables exist", () => { ); }, 30_000); - it("reporter has its columns", async () => { - const cols = await tableColumns("reporter"); - for (const c of [ - "key_id", - "pub_jwk", - "osm_uid", - "email_lookup_hmac", - "reputation_alpha", - "reputation_beta", - "corroborated_count", - "flagged_count", - "trust_signal", - "entitlement_expires_at", - "status", - "created_at", - "last_active_at", - ]) { - expect(cols.has(c)).toBe(true); + it("reporter has its columns and keeps nothing it does not use", async () => { + expect(await tableColumns("reporter")).toEqual( + new Set([ + "key_id", + "pub_jwk", + "reputation_alpha", + "reputation_beta", + "corroborated_count", + "trust_signal", + "entitlement_expires_at", + "status", + "created_at", + "last_active_at", + ]), + ); + }, 30_000); + + it("refuses a reporter without an activity or entitlement time, which retention reads", async () => { + for (const column of ["last_active_at", "entitlement_expires_at"]) { + const [col] = await sql<{ is_nullable: string }[]>` + SELECT is_nullable FROM information_schema.columns + WHERE table_schema = 'conditions' AND table_name = 'reporter' + AND column_name = ${column}`; + expect(col?.is_nullable).toBe("NO"); } + await expect( + sql`INSERT INTO conditions.reporter (key_id, pub_jwk, reputation_alpha, reputation_beta, + entitlement_expires_at, created_at, last_active_at) + VALUES ('k-no-activity', '{}'::jsonb, 1, 1, now(), now(), NULL)`, + ).rejects.toThrow(/last_active_at/); }, 30_000); it("token_quota and issuer_key have their columns", async () => { expect(await tableColumns("token_quota")).toEqual(new Set(["key_id", "epoch", "issued"])); expect(await tableColumns("issuer_key")).toEqual( - new Set(["key_id", "public_key", "private_key", "not_before", "not_after"]), + new Set([ + "key_id", + "public_key", + "private_key_ciphertext", + "private_key_iv", + "private_key_tag", + "not_before", + "not_after", + ]), ); }, 30_000); }); -describe("migration 0045 — crowd evidence keyed by record", () => { - it("sub_claim names its subject by class, id and component", async () => { +describe("crowd evidence keyed by record", () => { + it("sub_claim names its subject by class and id", async () => { expect(await tableColumns("sub_claim")).toEqual( new Set([ "id", "subject_class", "subject_id", - "subject_component_key", "claim_type", "key_id", "reason", @@ -101,19 +119,14 @@ describe("migration 0045 — crowd evidence keyed by record", () => { ); }, 30_000); - it("defaults the component keys to the empty string, never null", async () => { - const cols = await sql< - { table_name: string; column_name: string; is_nullable: string; column_default: string }[] - >` - SELECT table_name, column_name, is_nullable, column_default FROM information_schema.columns + it("defaults the evidence component key to the empty string, never null", async () => { + const cols = await sql<{ is_nullable: string; column_default: string }[]>` + SELECT is_nullable, column_default FROM information_schema.columns WHERE table_schema = 'conditions' - AND ((table_name = 'report_evidence' AND column_name = 'component_key') - OR (table_name = 'sub_claim' AND column_name = 'subject_component_key'))`; - expect(cols).toHaveLength(2); - for (const col of cols) { - expect(col.is_nullable).toBe("NO"); - expect(col.column_default).toContain("''"); - } + AND table_name = 'report_evidence' AND column_name = 'component_key'`; + expect(cols).toHaveLength(1); + expect(cols[0]!.is_nullable).toBe("NO"); + expect(cols[0]!.column_default).toContain("''"); }, 30_000); it("carries the evidence summary on situation with the right nullability", async () => { @@ -142,39 +155,162 @@ describe("migration 0045 — crowd evidence keyed by record", () => { const names = idx.map((i) => i.indexname); expect(names).toEqual( expect.arrayContaining([ - "uq_sub_claim_subject_key_type", - "idx_sub_claim_key", - "idx_report_evidence_record", - "idx_report_evidence_merged", - "idx_situation_crowd_evidence", + "sub_claim_subject_class_subject_id_key_id_claim_type_key", + "sub_claim_key_id_idx", + "report_evidence_record_class_record_id_occurred_at_idx", + "report_evidence_merged_idx", + "situation_evidence_state_crowd_idx", ]), ); expect(names).not.toContain("idx_report_evidence_observation"); expect(names).not.toContain("idx_sub_claim_subject"); + expect(names).not.toContain("uq_sub_claim_subject_key_type"); }, 30_000); }); -describe("migration 0009 — spent_token single-use ledger", () => { +describe("spent_token single-use ledger", () => { it("creates spent_token with its columns", async () => { expect(await tableColumns("spent_token")).toEqual( - new Set(["token_hash", "purpose", "spent_at"]), + new Set(["token_hash", "purpose", "spent_at", "expires_at"]), ); }, 30_000); it("token_hash is the primary key (a second spend violates it)", async () => { - await sql`INSERT INTO conditions.spent_token (token_hash, purpose, spent_at) - VALUES ('hash-dup', 'report:-:2026-07-12', now())`; + await sql`INSERT INTO conditions.spent_token (token_hash, purpose, spent_at, expires_at) + VALUES ('hash-dup', 'report:-:2026-07-12', now(), now())`; await expect( - sql`INSERT INTO conditions.spent_token (token_hash, purpose, spent_at) - VALUES ('hash-dup', 'report:-:2026-07-13', now())`, + sql`INSERT INTO conditions.spent_token (token_hash, purpose, spent_at, expires_at) + VALUES ('hash-dup', 'report:-:2026-07-13', now(), now())`, ).rejects.toThrow(/spent_token_pkey|duplicate key/); }, 30_000); - it("indexes spent_at for the retention sweep", async () => { - const idx = await sql<{ indexname: string }[]>` - SELECT indexname FROM pg_indexes - WHERE schemaname = 'conditions' AND tablename = 'spent_token'`; - expect(idx.map((i) => i.indexname)).toContain("idx_spent_token_spent_at"); + it("refuses a spent token without its expiry", async () => { + await expect( + sql`INSERT INTO conditions.spent_token (token_hash, purpose, spent_at) + VALUES ('hash-no-expiry', 'report:-:2026-07-12', now())`, + ).rejects.toThrow(/expires_at/); + }, 30_000); + + it("indexes the expiries the retention sweep reads", async () => { + const idx = await sql<{ tablename: string; indexname: string }[]>` + SELECT tablename, indexname FROM pg_indexes WHERE schemaname = 'conditions'`; + const names = idx.map((i) => `${i.tablename}.${i.indexname}`); + expect(names).toEqual( + expect.arrayContaining([ + "spent_token.spent_token_expires_at_idx", + "federation_tombstone.federation_tombstone_expires_at_idx", + "reporter.reporter_last_active_at_idx", + ]), + ); + expect(names).not.toContain("spent_token.spent_token_spent_at_idx"); + }, 30_000); +}); + +describe("reporter erasure", () => { + const FKS = [ + ["sub_claim", "sub_claim_key_id_fkey", "key_id", "c"], + ["report_refusal", "report_refusal_actor_key_id_fkey", "actor_key_id", "c"], + ["token_quota", "token_quota_key_id_fkey", "key_id", "c"], + ["report_evidence", "report_evidence_actor_key_id_fkey", "actor_key_id", "n"], + ] as const; + + it("references reporter from every table keyed by a reporter's key, each column indexed", async () => { + const fks = await sql< + { table: string; name: string; column: string; on_delete: string; target: string }[] + >` + SELECT c.conrelid::regclass::text AS table, c.conname AS name, + a.attname AS column, c.confdeltype AS on_delete, + c.confrelid::regclass::text AS target + FROM pg_constraint c + JOIN pg_attribute a ON a.attrelid = c.conrelid AND a.attnum = c.conkey[1] + WHERE c.contype = 'f' AND c.confrelid = 'conditions.reporter'::regclass + ORDER BY c.conname`; + expect( + fks.map((f) => [f.table.replace(/^conditions\./, ""), f.name, f.column, f.on_delete]), + ).toEqual([...FKS].sort((a, b) => a[1].localeCompare(b[1]))); + for (const [table, , column] of FKS) { + const [{ indexed }] = await sql<{ indexed: boolean }[]>` + SELECT EXISTS ( + SELECT 1 FROM pg_index i + JOIN pg_attribute a ON a.attrelid = i.indrelid AND a.attnum = i.indkey[0] + WHERE i.indrelid = ${`conditions.${table}`}::regclass AND a.attname = ${column} + ) AS indexed`; + expect(indexed, `${table}.${column} leads an index`).toBe(true); + } + }, 30_000); + + it("deletes a reporter's votes, refusals and quotas and clears it from its evidence", async () => { + const at = "2026-07-12T08:00:00.000Z"; + for (const key of ["k-erased", "k-kept"]) { + await sql`INSERT INTO conditions.reporter (key_id, pub_jwk, reputation_alpha, + reputation_beta, entitlement_expires_at, created_at, last_active_at) + VALUES (${key}, '{}'::jsonb, 1, 1, ${at}, ${at}, ${at})`; + await sql`INSERT INTO conditions.sub_claim + (id, subject_class, subject_id, claim_type, key_id, signature, created_at) + VALUES (${`sc-${key}`}, 'situation', 'subj-erasure', 'confirm', ${key}, 'sig', ${at})`; + await sql`INSERT INTO conditions.report_refusal (actor_key_id, cell, occurred_at) + VALUES (${key}, 'cell', ${at})`; + await sql`INSERT INTO conditions.token_quota (key_id, epoch, issued) + VALUES (${key}, '2026-07-12', 3)`; + await sql`INSERT INTO conditions.report_evidence + (record_class, record_id, evidence_kind, actor_key_id, occurred_at) + VALUES ('situation', 'subj-erasure', 'confirm', ${key}, ${at})`; + } + + await sql`DELETE FROM conditions.reporter WHERE key_id = 'k-erased'`; + + const count = async (table: string, column: string, key: string) => { + const [{ n }] = await sql.unsafe<{ n: number }[]>( + `SELECT count(*)::int AS n FROM conditions.${table} WHERE ${column} = $1`, + [key], + ); + return n; + }; + for (const [table, , column, action] of FKS) { + if (action !== "c") continue; + expect(await count(table, column, "k-erased"), table).toBe(0); + expect(await count(table, column, "k-kept"), table).toBe(1); + } + const evidence = await sql<{ actor_key_id: string | null }[]>` + SELECT actor_key_id FROM conditions.report_evidence + WHERE record_id = 'subj-erasure' ORDER BY actor_key_id NULLS FIRST`; + expect(evidence.map((e) => e.actor_key_id)).toEqual([null, "k-kept"]); + }, 30_000); + + it("strips a deleted reporter's key in a trigger running as the deleting role, search path pinned", async () => { + const [trigger] = await sql<{ name: string; before_delete_row: boolean; fn: string }[]>` + SELECT t.tgname AS name, + (t.tgtype & 1) = 1 AND (t.tgtype & 2) = 2 AND (t.tgtype & 8) = 8 AS before_delete_row, + t.tgfoid::regprocedure::text AS fn + FROM pg_trigger t + WHERE t.tgrelid = 'conditions.reporter'::regclass AND NOT t.tgisinternal`; + expect(trigger).toEqual({ + name: "reporter_strip_key", + before_delete_row: true, + fn: "conditions.reporter_strip_key()", + }); + const [fn] = await sql<{ prosecdef: boolean; proconfig: string[] }[]>` + SELECT prosecdef, proconfig FROM pg_proc + WHERE oid = 'conditions.reporter_strip_key()'::regprocedure`; + expect(fn).toEqual({ prosecdef: false, proconfig: ["search_path=pg_catalog, pg_temp"] }); + }, 30_000); + + it("refuses crowd rows of a key that is not an enrolled reporter", async () => { + await expect( + sql`INSERT INTO conditions.sub_claim + (id, subject_class, subject_id, claim_type, key_id, signature, created_at) + VALUES ('sc-stranger', 'situation', 'subj-1', 'confirm', 'k-stranger', 'sig', now())`, + ).rejects.toThrow(/sub_claim_key_id_fkey/); + await expect( + sql`INSERT INTO conditions.report_evidence + (record_class, record_id, evidence_kind, actor_key_id, occurred_at) + VALUES ('situation', 'subj-1', 'confirm', 'k-stranger', now())`, + ).rejects.toThrow(/report_evidence_actor_key_id_fkey/); + await expect( + sql`INSERT INTO conditions.report_evidence + (record_class, record_id, evidence_kind, actor_key_id, occurred_at) + VALUES ('situation', 'subj-1', 'report', NULL, now())`, + ).resolves.toBeDefined(); }, 30_000); }); @@ -184,7 +320,7 @@ describe("CHECK constraints", () => { sql`INSERT INTO conditions.reporter (key_id, pub_jwk, reputation_alpha, reputation_beta, entitlement_expires_at, created_at, last_active_at) VALUES ('k-bad-a', '{}'::jsonb, 0, 1, now(), now(), now())`, - ).rejects.toThrow(/reporter_reputation_alpha_positive/); + ).rejects.toThrow(/reporter_reputation_alpha_check/); }, 30_000); it("rejects a reporter with an unknown status", async () => { @@ -192,7 +328,7 @@ describe("CHECK constraints", () => { sql`INSERT INTO conditions.reporter (key_id, pub_jwk, reputation_alpha, reputation_beta, entitlement_expires_at, created_at, last_active_at, status) VALUES ('k-bad-s', '{}'::jsonb, 1, 1, now(), now(), now(), 'weird')`, - ).rejects.toThrow(/reporter_status_enum/); + ).rejects.toThrow(/reporter_status_check/); }, 30_000); it("rejects a sub_claim with an unknown claim_type", async () => { @@ -200,7 +336,7 @@ describe("CHECK constraints", () => { sql`INSERT INTO conditions.sub_claim (id, subject_class, subject_id, claim_type, key_id, signature, created_at) VALUES ('sc-bad', 'situation', 'subj-1', 'shout', 'k-1', 'sig', now())`, - ).rejects.toThrow(/sub_claim_claim_type_enum/); + ).rejects.toThrow(/sub_claim_claim_type_check/); }, 30_000); it("rejects a sub_claim whose subject is not a record class", async () => { @@ -208,7 +344,7 @@ describe("CHECK constraints", () => { sql`INSERT INTO conditions.sub_claim (id, subject_class, subject_id, claim_type, key_id, signature, created_at) VALUES ('sc-bad-class', 'observations', 'subj-1', 'confirm', 'k-1', 'sig', now())`, - ).rejects.toThrow(/sub_claim_subject_class_enum/); + ).rejects.toThrow(/sub_claim_subject_class_check/); }, 30_000); it("rejects a report_evidence with an unknown evidence_kind", async () => { @@ -216,7 +352,7 @@ describe("CHECK constraints", () => { sql`INSERT INTO conditions.report_evidence (record_class, record_id, evidence_kind, occurred_at) VALUES ('situation', 'sit-1', 'telepathy', now())`, - ).rejects.toThrow(/report_evidence_kind_enum/); + ).rejects.toThrow(/report_evidence_evidence_kind_check/); }, 30_000); it("rejects a report_evidence whose record is not a record class", async () => { @@ -224,14 +360,14 @@ describe("CHECK constraints", () => { sql`INSERT INTO conditions.report_evidence (record_class, record_id, evidence_kind, occurred_at) VALUES ('observations', 'obs-1', 'report', now())`, - ).rejects.toThrow(/report_evidence_record_class_enum/); + ).rejects.toThrow(/report_evidence_record_class_check/); }, 30_000); it("rejects a situation with an unknown evidence_state", async () => { const id = await seedFeedSituation(sql, "evidence-state-check"); await expect( sql`UPDATE conditions.situation SET evidence_state = 'nonsense' WHERE id = ${id}`, - ).rejects.toThrow(/situation_evidence_state_enum/); + ).rejects.toThrow(/situation_evidence_state_check/); await expect( sql`UPDATE conditions.situation SET evidence_state = 'self_reported' WHERE id = ${id}`, ).resolves.toBeDefined(); @@ -240,6 +376,9 @@ describe("CHECK constraints", () => { describe("unique sub_claim (subject, key, type)", () => { it("rejects a duplicate (subject, key, claim_type) sub-claim", async () => { + await sql`INSERT INTO conditions.reporter (key_id, pub_jwk, reputation_alpha, reputation_beta, + entitlement_expires_at, created_at, last_active_at) + VALUES ('key-dup', '{}'::jsonb, 1, 1, now(), now(), now())`; await sql`INSERT INTO conditions.sub_claim (id, subject_class, subject_id, claim_type, key_id, signature, created_at) VALUES ('sc-1', 'situation', 'subj-dup', 'confirm', 'key-dup', 'sig-1', now())`; @@ -247,7 +386,7 @@ describe("unique sub_claim (subject, key, type)", () => { sql`INSERT INTO conditions.sub_claim (id, subject_class, subject_id, claim_type, key_id, signature, created_at) VALUES ('sc-2', 'situation', 'subj-dup', 'confirm', 'key-dup', 'sig-2', now())`, - ).rejects.toThrow(/uq_sub_claim_subject_key_type/); + ).rejects.toThrow(/sub_claim_subject_class_subject_id_key_id_claim_type_key/); }, 30_000); it("allows the same key a different claim_type on the same subject", async () => { @@ -258,7 +397,7 @@ describe("unique sub_claim (subject, key, type)", () => { ).resolves.toBeDefined(); }, 30_000); - it("tells subjects apart by class and component", async () => { + it("tells subjects apart by class", async () => { await expect( sql`INSERT INTO conditions.sub_claim (id, subject_class, subject_id, claim_type, key_id, signature, created_at) @@ -266,15 +405,8 @@ describe("unique sub_claim (subject, key, type)", () => { ).resolves.toBeDefined(); await expect( sql`INSERT INTO conditions.sub_claim - (id, subject_class, subject_id, subject_component_key, claim_type, key_id, signature, - created_at) - VALUES ('sc-5', 'feature', 'subj-dup', 'evse-1', 'confirm', 'key-dup', 'sig-5', now())`, - ).resolves.toBeDefined(); - await expect( - sql`INSERT INTO conditions.sub_claim - (id, subject_class, subject_id, subject_component_key, claim_type, key_id, signature, - created_at) - VALUES ('sc-6', 'feature', 'subj-dup', 'evse-1', 'confirm', 'key-dup', 'sig-6', now())`, - ).rejects.toThrow(/uq_sub_claim_subject_key_type/); + (id, subject_class, subject_id, claim_type, key_id, signature, created_at) + VALUES ('sc-5', 'feature', 'subj-dup', 'confirm', 'key-dup', 'sig-5', now())`, + ).rejects.toThrow(/sub_claim_subject_class_subject_id_key_id_claim_type_key/); }, 30_000); }); diff --git a/services/contributions-api/src/__tests__/subclaims.integration.test.ts b/services/contributions-api/src/__tests__/subclaims.integration.test.ts index 942727a67..34720e227 100644 --- a/services/contributions-api/src/__tests__/subclaims.integration.test.ts +++ b/services/contributions-api/src/__tests__/subclaims.integration.test.ts @@ -10,7 +10,11 @@ import { } from "@openconditions/contrib-core"; import { crowdLocalId } from "@openconditions/model"; import { tombstoneRecords } from "@openconditions/storage"; -import { createTestDatabase, type TestDatabase } from "@openconditions/test-database"; +import { + createTestDatabase, + TEST_SECRETS_KEY, + type TestDatabase, +} from "@openconditions/test-database"; import type { FastifyInstance } from "fastify"; import type postgres from "postgres"; import { afterAll, beforeAll, beforeEach, describe, expect, it } from "vitest"; @@ -42,6 +46,7 @@ beforeAll(async () => { sql, env: { OPENCONDITIONS_GRANT_SECRET: GRANT_SECRET_VALUE, + OPENCONDITIONS_SECRETS_KEY: TEST_SECRETS_KEY, OPENCONDITIONS_INSTANCE_ID: INSTANCE, }, logger: false, @@ -319,18 +324,16 @@ describe("POST /contrib/reports/situation/:id/confirm — idempotency", () => { id: string; subject_class: string; subject_id: string; - subject_component_key: string; signature: string; }[] >` - SELECT id, subject_class, subject_id, subject_component_key, signature + SELECT id, subject_class, subject_id, signature FROM conditions.sub_claim WHERE key_id = ${keyB.keyId}`; expect(rows).toEqual([ { id: crowdLocalId(keyB.keyId, nonce), subject_class: "situation", subject_id: id, - subject_component_key: "", signature: sub.signature, }, ]); diff --git a/services/contributions-api/src/attester/verifier.ts b/services/contributions-api/src/attester/verifier.ts index 4b14db562..578b5c0d9 100644 --- a/services/contributions-api/src/attester/verifier.ts +++ b/services/contributions-api/src/attester/verifier.ts @@ -62,18 +62,17 @@ export interface OsmAuthVerifierCtx { } /** - * Outcome of an OSM-auth verification attempt. `verified` gates the trust bump; - * `osmUid` is the OSM numeric user id when the verifier could resolve it. + * Outcome of an OSM-auth verification attempt. `verified` gates the trust bump. + * Nothing about the OSM account is kept: the reporter stays pseudonymous. */ export interface OsmAuthVerificationResult { verified: boolean; reason?: string; - osmUid?: string; } /** * Pluggable OSM-auth verifier. An implementation confirms the presented OSM - * OAuth token against OSM's API and (optionally) captures the account's uid. + * OAuth token against OSM's API and keeps nothing of the account. * Only a `verified: true` result grants the advisory trust bump — the mere * PRESENCE of an `osmAuth` string buys nothing, exactly like attestation. */ @@ -84,8 +83,8 @@ export interface OsmAuthVerifier { /** * Default production OSM-auth verifier: confirms NOTHING. No OSM API client is * wired here yet, so every presented token is treated as unverified and grants - * no trust. Real OSM OAuth verification (call OSM's API to confirm the token and - * capture the uid) is a documented FOLLOW-ON that plugs into this seam by + * no trust. Real OSM OAuth verification (call OSM's API to confirm the token) + * is a documented FOLLOW-ON that plugs into this seam by * supplying its own {@link OsmAuthVerifier}. Absent OR unverified osmAuth leaves * the reporter fully eligible — osmAuth is advisory, never a gate. */ diff --git a/services/contributions-api/src/contrib.ts b/services/contributions-api/src/contrib.ts index 60278a0ee..2236700ea 100644 --- a/services/contributions-api/src/contrib.ts +++ b/services/contributions-api/src/contrib.ts @@ -46,9 +46,12 @@ export { export { type IssueLogger, type IssueResult, issueToken } from "./issuer/issue.js"; export { type ActiveIssuerKey, + assertIssuerKeysOpen, DEFAULT_ISSUER_NAME, ensureIssuerKeys, generateIssuerKey, + type IssuerPublicKey, loadActiveIssuerKeys, + loadIssuerPublicKeys, } from "./issuer/keys.js"; export { TokenVerifier, type TokenVerifierOptions } from "./issuer/verify.js"; diff --git a/services/contributions-api/src/evidence/corroborate.ts b/services/contributions-api/src/evidence/corroborate.ts index f857c8559..70bc96deb 100644 --- a/services/contributions-api/src/evidence/corroborate.ts +++ b/services/contributions-api/src/evidence/corroborate.ts @@ -176,10 +176,15 @@ export async function applyCorroboration( const actor = actorOf(merged.record); const landedAt = (merged.record["freshness"] as { fetchedAt: string }).fetchedAt; + // The merged report's record still names its reporter after the + // reporter was deleted; the evidence then credits no key, like the + // reporter's other evidence. await tx` INSERT INTO conditions.report_evidence (record_class, record_id, evidence_kind, actor_key_id, source_id, occurred_at, details) - SELECT 'situation', ${survivor.id}, 'confirm', ${actor.keyId ?? null}, ${actor.sourceId}, + SELECT 'situation', ${survivor.id}, 'confirm', + (SELECT key_id FROM conditions.reporter WHERE key_id = ${actor.keyId ?? null}), + ${actor.sourceId}, ${landedAt}, ${tx.json({ via: "phenomenon-match", merged: merged.id })} WHERE NOT EXISTS ( SELECT 1 FROM conditions.report_evidence diff --git a/services/contributions-api/src/index.ts b/services/contributions-api/src/index.ts index df142e101..8362bc247 100644 --- a/services/contributions-api/src/index.ts +++ b/services/contributions-api/src/index.ts @@ -44,10 +44,13 @@ export { export { type IssueResult, issueToken } from "./issuer/issue.js"; export { type ActiveIssuerKey, + assertIssuerKeysOpen, DEFAULT_ISSUER_NAME, ensureIssuerKeys, generateIssuerKey, + type IssuerPublicKey, loadActiveIssuerKeys, + loadIssuerPublicKeys, } from "./issuer/keys.js"; export { TokenVerifier } from "./issuer/verify.js"; export { diff --git a/services/contributions-api/src/issuer/issue.ts b/services/contributions-api/src/issuer/issue.ts index b8863c06a..9b6c2127c 100644 --- a/services/contributions-api/src/issuer/issue.ts +++ b/services/contributions-api/src/issuer/issue.ts @@ -13,6 +13,7 @@ */ import { publicVerif } from "@cloudflare/privacypass-ts"; +import type { SecretsKey } from "@openconditions/core/server"; import type postgres from "postgres"; import { ATTESTER_POLICY } from "../attester/policy.js"; import { type PublicContext, publicContextString } from "./context.js"; @@ -20,6 +21,18 @@ import { type ActiveIssuerKey, DEFAULT_ISSUER_NAME, loadActiveIssuerKeys } from const { BLIND_RSA, TokenRequest } = publicVerif; +function loadKeys(sql: postgres.Sql, deps: IssueDeps): Promise { + if (deps.secrets === undefined) { + throw new Error("issueToken needs the issuer keys, or the secrets key to load them"); + } + return loadActiveIssuerKeys( + sql, + deps.secrets, + deps.now ?? new Date().toISOString(), + deps.issuerName ?? DEFAULT_ISSUER_NAME, + ); +} + export interface IssueLogger { info: (obj: Record, msg?: string) => void; warn: (obj: Record, msg?: string) => void; @@ -34,8 +47,10 @@ export type IssueResult = export interface IssueDeps { log: IssueLogger; - /** Currently valid issuer keys; loaded from the DB when omitted. */ + /** Currently valid issuer keys; loaded from the DB with `secrets` when omitted. */ keys?: ActiveIssuerKey[]; + /** The key the issuer keys' private halves are sealed with, to load them. */ + secrets?: SecretsKey; /** Per-epoch issuance ceiling; defaults to the attester policy. */ cap?: number; issuerName?: string; @@ -87,13 +102,7 @@ export async function issueToken( return { issued: false, reason: "bad-request" }; } - const keys = - deps.keys ?? - (await loadActiveIssuerKeys( - sql, - deps.now ?? new Date().toISOString(), - deps.issuerName ?? DEFAULT_ISSUER_NAME, - )); + const keys = deps.keys ?? (await loadKeys(sql, deps)); const issuerKey = keys.find((k) => k.truncatedTokenKeyId === request.truncatedTokenKeyId); if (issuerKey === undefined) { log.warn({ purpose, epoch, outcome: "bad-request" }, "token issuance refused: unknown key id"); diff --git a/services/contributions-api/src/issuer/keys.ts b/services/contributions-api/src/issuer/keys.ts index 17ccdc4e6..c231ae1fc 100644 --- a/services/contributions-api/src/issuer/keys.ts +++ b/services/contributions-api/src/issuer/keys.ts @@ -3,14 +3,22 @@ * (RFC 9578, token type 0x0002) via @cloudflare/privacypass-ts. * * Keys live in conditions.issuer_key (an operator-secret table): the private - * key as PKCS#8, the public key as WebCrypto SPKI. Clients receive the - * RSASSA-PSS-OID form of the public key (what `Client.createTokenRequest` - * expects); its SHA-256 is the RFC 9578 token key id. Rotation = a new row - * with an overlapping [not_before, not_after) window — redemption accepts any - * key valid at redemption time. Key MATERIAL is never logged. + * key as PKCS#8, sealed with the instance's secrets key, the public key as + * WebCrypto SPKI. Clients receive the RSASSA-PSS-OID form of the public key + * (what `Client.createTokenRequest` expects); its SHA-256 is the RFC 9578 + * token key id. Rotation = a new row with an overlapping [not_before, + * not_after) window — redemption accepts any key valid at redemption time. + * Key MATERIAL is never logged. */ import { publicVerif } from "@cloudflare/privacypass-ts"; +import { + assertStoredSecretsOpen, + ISSUER_KEY_SECRETS, + type SecretPlace, + type SecretsKey, + storedSecret, +} from "@openconditions/core/server"; import type postgres from "postgres"; const { BLIND_RSA, BlindRSAMode, Issuer, getPublicKeyBytes } = publicVerif; @@ -21,10 +29,16 @@ export const DEFAULT_ISSUER_NAME = "contributions.openconditions.org"; /** Issuer key validity window written at generation time. */ export const ISSUER_KEY_VALIDITY_DAYS = 90; -export interface ActiveIssuerKey { +const privateKeyPlace = (keyId: string): SecretPlace => ({ + table: ISSUER_KEY_SECRETS.table, + column: "private_key", + row: keyId, +}); + +/** An issuer key's public half, which redemption and the published key list need. */ +export interface IssuerPublicKey { /** SHA-256 hex of the published (RSASSA-PSS SPKI) public key bytes. */ keyId: string; - issuer: InstanceType; publicKey: CryptoKey; /** Public key bytes in the form clients blind against. */ publicKeyBytes: Uint8Array; @@ -36,10 +50,14 @@ export interface ActiveIssuerKey { notAfter: Date; } +/** An issuer key that signs: its public half and the Issuer holding its private key. */ +export interface ActiveIssuerKey extends IssuerPublicKey { + issuer: InstanceType; +} + interface IssuerKeyRow { key_id: string; public_key: Buffer; - private_key: Buffer; not_before: Date; not_after: Date; } @@ -123,6 +141,7 @@ async function generatePair(): Promise { */ export async function generateIssuerKey( sql: postgres.Sql, + secrets: SecretsKey, nowIso: string, options: GenerateIssuerKeyOptions = {}, ): Promise<{ keyId: string }> { @@ -170,75 +189,124 @@ export async function generateIssuerKey( await globalThis.crypto.subtle.exportKey("spki", pair.publicKey), ); + const sealed = secrets.seal(privatePkcs8, privateKeyPlace(keyId)); + privatePkcs8.fill(0); await tx` - INSERT INTO conditions.issuer_key (key_id, public_key, private_key, not_before, not_after) - VALUES (${keyId}, ${Buffer.from(publicSpki)}, ${Buffer.from(privatePkcs8)}, - ${notBefore}, ${notAfter}) + INSERT INTO conditions.issuer_key + (key_id, public_key, private_key_ciphertext, private_key_iv, private_key_tag, + not_before, not_after) + VALUES (${keyId}, ${Buffer.from(publicSpki)}, ${Buffer.from(sealed.ciphertext)}, + ${Buffer.from(sealed.iv)}, ${Buffer.from(sealed.tag)}, ${notBefore}, ${notAfter}) ON CONFLICT (key_id) DO NOTHING `; return { keyId }; }); } +async function publicKeyOf(row: IssuerKeyRow): Promise { + const publicKey = await globalThis.crypto.subtle.importKey( + "spki", + new Uint8Array(row.public_key), + BLIND_RSA.rsaParams, + true, + ["verify"], + ); + const publicKeyBytes = await getPublicKeyBytes(publicKey); + const tokenKeyId = await sha256(publicKeyBytes); + return { + keyId: row.key_id, + publicKey, + publicKeyBytes, + tokenKeyId, + truncatedTokenKeyId: tokenKeyId[tokenKeyId.length - 1]!, + notBefore: row.not_before, + notAfter: row.not_after, + }; +} + /** - * Loads every issuer key valid at `nowIso` (newest first) and rehydrates the - * WebCrypto handles + privacypass-ts Issuer for each. + * The public half of every issuer key valid at `nowIso` (newest first): what + * redemption verifies against and the published key list serves. Reads no + * private key. */ -export async function loadActiveIssuerKeys( +export async function loadIssuerPublicKeys( sql: postgres.Sql, nowIso: string, +): Promise { + const now = new Date(nowIso); + const rows = await sql` + SELECT key_id, public_key, not_before, not_after + FROM conditions.issuer_key + WHERE not_before <= ${now} AND not_after > ${now} + ORDER BY not_before DESC + `; + return Promise.all(rows.map(publicKeyOf)); +} + +/** + * Loads every issuer key valid at `nowIso` (newest first), opens its private + * key with `secrets` and rehydrates the WebCrypto handles + privacypass-ts + * Issuer for each. + */ +export async function loadActiveIssuerKeys( + sql: postgres.Sql | postgres.TransactionSql, + secrets: SecretsKey, + nowIso: string, issuerName: string, ): Promise { const now = new Date(nowIso); - const rows = await sql` - SELECT key_id, public_key, private_key, not_before, not_after + const rows = await sql<(IssuerKeyRow & postgres.Row)[]>` + SELECT key_id, public_key, private_key_ciphertext, private_key_iv, private_key_tag, + not_before, not_after FROM conditions.issuer_key WHERE not_before <= ${now} AND not_after > ${now} ORDER BY not_before DESC `; return Promise.all( rows.map(async (row) => { + const place = privateKeyPlace(row.key_id); + const sealed = storedSecret(row, place); + if (sealed === null) + throw new Error(`conditions.issuer_key ${row.key_id} has no private key`); + const pkcs8 = secrets.open(sealed, place); const privateKey = await globalThis.crypto.subtle.importKey( "pkcs8", - new Uint8Array(row.private_key), + new Uint8Array(pkcs8), BLIND_RSA.rsaParams, true, ["sign"], ); - const publicKey = await globalThis.crypto.subtle.importKey( - "spki", - new Uint8Array(row.public_key), - BLIND_RSA.rsaParams, - true, - ["verify"], - ); - const publicKeyBytes = await getPublicKeyBytes(publicKey); - const tokenKeyId = await sha256(publicKeyBytes); + pkcs8.fill(0); + const key = await publicKeyOf(row); return { - keyId: row.key_id, - issuer: new Issuer(BlindRSAMode.PSS, issuerName, privateKey, publicKey), - publicKey, - publicKeyBytes, - tokenKeyId, - truncatedTokenKeyId: tokenKeyId[tokenKeyId.length - 1]!, - notBefore: row.not_before, - notAfter: row.not_after, + ...key, + issuer: new Issuer(BlindRSAMode.PSS, issuerName, privateKey, key.publicKey), }; }), ); } +/** + * Opens every stored issuer private key under `secrets`, expired ones too, + * so a key that is not the one they were sealed with stops the start with a + * "wrong key" error naming the key id. + */ +export function assertIssuerKeysOpen(sql: postgres.Sql, secrets: SecretsKey): Promise { + return assertStoredSecretsOpen(sql, secrets, ISSUER_KEY_SECRETS); +} + /** * First-boot bootstrap: loads the currently valid keys and generates one when * none exists yet. */ export async function ensureIssuerKeys( sql: postgres.Sql, + secrets: SecretsKey, nowIso: string, issuerName: string, ): Promise { - const existing = await loadActiveIssuerKeys(sql, nowIso, issuerName); + const existing = await loadActiveIssuerKeys(sql, secrets, nowIso, issuerName); if (existing.length > 0) return existing; - await generateIssuerKey(sql, nowIso); - return loadActiveIssuerKeys(sql, nowIso, issuerName); + await generateIssuerKey(sql, secrets, nowIso); + return loadActiveIssuerKeys(sql, secrets, nowIso, issuerName); } diff --git a/services/contributions-api/src/issuer/verify.ts b/services/contributions-api/src/issuer/verify.ts index ad96de054..44589d0a6 100644 --- a/services/contributions-api/src/issuer/verify.ts +++ b/services/contributions-api/src/issuer/verify.ts @@ -7,7 +7,8 @@ * conditions.spent_token — a conflict on the primary key means the token * was already spent, so the answer is false before any crypto runs. If * the insert succeeds but verification then fails, the row is KEPT: a bad - * token burning its own hash is harmless. + * token burning its own hash is harmless. The row expires with the issuer + * key the token names, after which the token cannot redeem anyway. * 2. Rebuild the expected TokenChallenge from the domain-separated public * context and compare its SHA-256 against the challengeDigest the token * signed over (constant-time). A token issued for context A can never @@ -26,7 +27,7 @@ import { publicVerif, Token } from "@cloudflare/privacypass-ts"; import type postgres from "postgres"; import { type PublicContext, publicContextString, redemptionContext } from "./context.js"; import type { IssueLogger } from "./issue.js"; -import { loadActiveIssuerKeys } from "./keys.js"; +import { loadIssuerPublicKeys } from "./keys.js"; const { BLIND_RSA, BlindRSAMode, Origin } = publicVerif; @@ -55,9 +56,25 @@ export class TokenVerifier { await globalThis.crypto.subtle.digest("SHA-256", tokenBytes as BufferSource), ).toString("hex"); + let token: Token | undefined; + try { + token = Token.deserialize(BLIND_RSA, tokenBytes); + } catch { + token = undefined; + } + + // The token expires with the issuer key it names: no token redeems + // after its key's validity ends, so its spent row is kept until then. A + // token that names no stored key, or does not parse, can never redeem, + // and its row may go at once. + const now = new Date(nowIso); + const namedKeyId = + token === undefined ? null : Buffer.from(token.authInput.tokenKeyId).toString("hex"); const inserted = await sql<{ token_hash: string }[]>` - INSERT INTO conditions.spent_token (token_hash, purpose, spent_at) - VALUES (${tokenHash}, ${purpose}, ${new Date(nowIso)}) + INSERT INTO conditions.spent_token (token_hash, purpose, spent_at, expires_at) + VALUES (${tokenHash}, ${purpose}, ${now}, + COALESCE((SELECT not_after FROM conditions.issuer_key WHERE key_id = ${namedKeyId}), + ${now})) ON CONFLICT (token_hash) DO NOTHING RETURNING token_hash `; @@ -66,10 +83,7 @@ export class TokenVerifier { return false; } - let token: Token; - try { - token = Token.deserialize(BLIND_RSA, tokenBytes); - } catch { + if (token === undefined) { this.log.info({ purpose, outcome: "malformed" }, "token redemption refused"); return false; } @@ -94,7 +108,7 @@ export class TokenVerifier { return false; } - const keys = await loadActiveIssuerKeys(sql, nowIso, this.issuerName); + const keys = await loadIssuerPublicKeys(sql, nowIso); const issuerKey = keys.find( (k) => k.tokenKeyId.length === token.authInput.tokenKeyId.length && diff --git a/services/contributions-api/src/main.ts b/services/contributions-api/src/main.ts index 6987e3717..acf4e2114 100644 --- a/services/contributions-api/src/main.ts +++ b/services/contributions-api/src/main.ts @@ -1,10 +1,17 @@ /** - * Boot entry for the contributions service: applies migrations, opens the - * shared postgres pool, builds the Fastify app, and listens. Tests import - * build() from server.ts instead of running this file. + * Boot entry for the contributions service: opens the shared postgres pool, + * waits until the ingest service has migrated the database to this build's + * schema version, builds the Fastify app, and listens. Tests import build() + * from server.ts instead of running this file. */ -import { assertStoredCodesRegistered, runMigrations } from "@openconditions/core/server"; +import { + assertStoredCodesRegistered, + schemaWaitTimeoutMs, + secretsKeyFromEnv, + waitForSchemaVersion, + waitForSecretsKeyCheck, +} from "@openconditions/core/server"; import { requireCredential } from "@openconditions/ingest-framework"; import { productionRegistry } from "@openconditions/model-registry"; import postgres from "postgres"; @@ -30,9 +37,10 @@ const CROSS_VALIDATE_SWEEP_MS = 3 * 60_000; async function boot() { const url = requireCredential(process.env, "DATABASE_URL"); - console.info("[contributions-api] applying database migrations…"); - await runMigrations(url); - console.info("[contributions-api] migrations applied"); + // A malformed timeout or a missing or malformed key fails boot before the + // database is read. + const schemaWaitMs = schemaWaitTimeoutMs(process.env, "OPENCONDITIONS_SCHEMA_WAIT_TIMEOUT_MS"); + const secretsKey = secretsKeyFromEnv(process.env); // Requests and short sweeps only: a statement past 30 s or a lock wait past // 10 s fails rather than holding one of the five connections. Startup @@ -48,6 +56,22 @@ async function boot() { idle_in_transaction_session_timeout: 60_000, }, }); + // The ingest service migrates; this service only reads the version it reached. + await waitForSchemaVersion(sql, { + timeoutMs: schemaWaitMs, + onWait: (found, expected) => + console.info( + `[contributions-api] waiting for the ingest service to migrate the database to ${expected.tag}: ${found}`, + ), + }); + console.info("[contributions-api] database schema is at this build's version"); + // The ingest service seals the key check right after migrating; a key other + // than the ingest service's stops the boot before an issuer key is sealed. + await waitForSecretsKeyCheck(sql, secretsKey, { + timeoutMs: schemaWaitMs, + onWait: () => + console.info("[contributions-api] waiting for the ingest service to seal the key check"), + }); const registry = productionRegistry(); await assertStoredCodesRegistered(sql, registry, { sourceFormats: false }); const app = await build({ sql, registry }); diff --git a/services/contributions-api/src/server.ts b/services/contributions-api/src/server.ts index 0de571377..b24ad4286 100644 --- a/services/contributions-api/src/server.ts +++ b/services/contributions-api/src/server.ts @@ -18,7 +18,11 @@ import { verifySubClaim, } from "@openconditions/contrib-core"; import { type GeoJsonGeometry, reliabilityLowerBound } from "@openconditions/core"; -import { resolveInstanceId } from "@openconditions/core/server"; +import { + resolveInstanceId, + secretsKeyFromEnv, + verifySecretsKeyCheck, +} from "@openconditions/core/server"; import { resolveCrowdCredit } from "@openconditions/ingest-framework"; import { type LandingContext, RECORD_CLASSES, type Registry } from "@openconditions/model"; import { productionRegistry } from "@openconditions/model-registry"; @@ -40,7 +44,12 @@ import { crossValidateAgainstFeeds } from "./evidence/crossValidate.js"; import { crossValidateObservation } from "./evidence/crossValidateObservation.js"; import { type PublicContext, reportEpoch } from "./issuer/context.js"; import { issueToken } from "./issuer/issue.js"; -import { DEFAULT_ISSUER_NAME, ensureIssuerKeys, loadActiveIssuerKeys } from "./issuer/keys.js"; +import { + assertIssuerKeysOpen, + DEFAULT_ISSUER_NAME, + ensureIssuerKeys, + loadIssuerPublicKeys, +} from "./issuer/keys.js"; import { TokenVerifier } from "./issuer/verify.js"; import { ClaimRefusedError, GeometryInvalidError, landReport } from "./landing/land.js"; import { ConflictingReportError, landObservationReport } from "./landing/observation.js"; @@ -194,6 +203,9 @@ export async function build(options: BuildOptions): Promise { const attestationVerifier = options.attestationVerifier ?? UNVERIFIED_ATTESTATION; const osmAuthVerifier = options.osmAuthVerifier ?? UNVERIFIED_OSM_AUTH; const issuerName = env["OPENCONDITIONS_ISSUER_NAME"] || DEFAULT_ISSUER_NAME; + // The issuer keys' private halves are sealed with it: a missing or malformed + // key fails boot, and so does one that cannot open the stored keys. + const secretsKey = secretsKeyFromEnv(env); // Validated before anything starts, so a misspelt licence or link aborts the boot. const instanceId = resolveInstanceId(env); const crowd = resolveCrowdCredit(env, instanceId); @@ -212,7 +224,16 @@ export async function build(options: BuildOptions): Promise { const reviewerToken = resolveReviewerToken(env, (msg) => attesterLog.warn(msg)); const requireReviewer = makeRequireReviewer(reviewerToken); - await ensureIssuerKeys(sql, now(), issuerName); + // A key other than the one the ingest service sealed the check row with + // stops the boot; then every stored issuer key must open. An absent row is + // let through on purpose: the only callers are main.ts, which has already + // waited for the row with waitForSecretsKeyCheck, and tests that build the + // server on a database no ingest service started on. None of the package's + // entry points exposes this function, so no other path reaches it without + // that wait. + await verifySecretsKeyCheck(sql, secretsKey); + await assertIssuerKeysOpen(sql, secretsKey); + await ensureIssuerKeys(sql, secretsKey, now(), issuerName); const verifier = new TokenVerifier({ issuerName, log: originLog }); app.decorate("tokenVerifier", verifier); @@ -305,6 +326,7 @@ export async function build(options: BuildOptions): Promise { const result = await issueToken(sql, keyId, epoch, blindedRequestBytes, publicContext, { log: issuerLog, issuerName, + secrets: secretsKey, now: nowIso, }); if (!result.issued) { @@ -826,7 +848,7 @@ export async function build(options: BuildOptions): Promise { ); app.get("/contrib/issuer-keys", async (_req, reply) => { - const keys = await loadActiveIssuerKeys(sql, now(), issuerName); + const keys = await loadIssuerPublicKeys(sql, now()); return reply.send({ issuer: issuerName, keys: keys.map((k) => ({ diff --git a/services/contributions-api/tsup.config.ts b/services/contributions-api/tsup.config.ts index ac307fdce..08a38fd34 100644 --- a/services/contributions-api/tsup.config.ts +++ b/services/contributions-api/tsup.config.ts @@ -4,10 +4,11 @@ import { defineConfig } from "tsup"; // @openconditions/core is inlined into this bundle (noExternal), so its // drizzle-kit migrations folder no longer travels with it. The main.ts entry -// runMigrations() at boot and reads those files at runtime, so copy them next -// to the bundle entry (dist/drizzle); core resolves `./drizzle` there. Lives -// inside dist/ so it rides the turbo `dist/**` output cache and the Docker -// `COPY dist`. +// migrates nothing, but waitForSchemaVersion() reads the journal at boot for +// the version this build expects, so copy the folder next to the bundle entry +// (dist/drizzle), the same layout as the ingest image; core resolves +// `./drizzle` there. Lives inside dist/ so it rides the turbo `dist/**` output +// cache and the Docker `COPY dist`. const coreDrizzle = fileURLToPath(new URL("../../packages/core/drizzle", import.meta.url)); const bundledDrizzle = fileURLToPath(new URL("./dist/drizzle", import.meta.url)); diff --git a/services/federation/service.json b/services/federation/service.json index 82af5f163..7979b95d6 100644 --- a/services/federation/service.json +++ b/services/federation/service.json @@ -66,6 +66,12 @@ "default": "", "x-openmapx-secret": false }, + "OPENCONDITIONS_SECRETS_KEY": { + "type": "string", + "title": "Secrets key", + "description": "Required when enabled. Copy the value of openconditions-ingest's Secrets key; never generate a new one. The instance's federation private keys are encrypted with it; without it a new instance key must be made, which changes this instance's federation identity and has every peer pin it again. Enabled, the service refuses to start with a key other than the one the ingest service holds, or one that cannot decrypt the stored instance keys. It is not recoverable from the OpenConditions tables: the copy in your recovery set is the ingest service's.", + "x-openmapx-secret": true + }, "OPENCONDITIONS_INSTANCE_ID": { "type": "string", "title": "Instance id", @@ -73,6 +79,13 @@ "default": "", "x-openmapx-secret": false }, + "OPENCONDITIONS_SCHEMA_WAIT_TIMEOUT_MS": { + "type": "string", + "title": "Schema wait timeout (ms)", + "description": "The ingest service migrates the database; this service waits at start until the schema is at its version or newer, and stops with what it expected and found after this long. Empty: 300000.", + "default": "", + "x-openmapx-secret": false + }, "OPENCONDITIONS_FEDERATION_ACTOR": { "type": "string", "title": "Actor config", diff --git a/services/federation/src/__tests__/archive.integration.test.ts b/services/federation/src/__tests__/archive.integration.test.ts index b3104a3f2..48317bd1f 100644 --- a/services/federation/src/__tests__/archive.integration.test.ts +++ b/services/federation/src/__tests__/archive.integration.test.ts @@ -7,7 +7,7 @@ import { createHash } from "node:crypto"; import { mkdtemp, readFile, rm, writeFile } from "node:fs/promises"; import { tmpdir } from "node:os"; import path from "node:path"; -import { runMigrations } from "@openconditions/core/server"; +import { runMigrations, SecretsKey } from "@openconditions/core/server"; import { InMemoryNonceStore, type InstanceKey, @@ -23,6 +23,7 @@ import { tombstoneRecords, writeSnapshot, } from "@openconditions/storage"; +import { TEST_SECRETS_KEY } from "@openconditions/test-database"; import { assertPostgisProfile, POSTGIS_IMAGES, @@ -39,6 +40,7 @@ import { pullPeer } from "../puller.js"; import { build } from "../server.js"; import { registry } from "./record-fixtures.js"; +const secrets = SecretsKey.parse(TEST_SECRETS_KEY); const A = "a.example.org"; const D = "d.example.org"; const SOURCE = "nl-ndw-events"; @@ -198,13 +200,14 @@ beforeAll(async () => { archiveDir = await mkdtemp(path.join(tmpdir(), "oc-archive-test-")); const now = new Date().toISOString(); - await maintainInstanceKey(sqlA, now, A); - await maintainInstanceKey(sqlD, now, D); - const [keyA] = (await loadActiveKeys(sqlA, now)) as [InstanceKey]; - [keyD] = (await loadActiveKeys(sqlD, now)) as [InstanceKey]; + await maintainInstanceKey(sqlA, secrets, now, A); + await maintainInstanceKey(sqlD, secrets, now, D); + const [keyA] = (await loadActiveKeys(sqlA, secrets, now)) as [InstanceKey]; + [keyD] = (await loadActiveKeys(sqlD, secrets, now)) as [InstanceKey]; const envA = { OPENCONDITIONS_FEDERATION_ENABLED: "true", + OPENCONDITIONS_SECRETS_KEY: TEST_SECRETS_KEY, OPENCONDITIONS_INSTANCE_ID: A, OPENCONDITIONS_FEDERATION_ACTOR: JSON.stringify(actor(A)), OPENCONDITIONS_FEDERATION_PEERS: JSON.stringify([peer(D, keyD)]), @@ -212,6 +215,7 @@ beforeAll(async () => { }; const envD = { OPENCONDITIONS_FEDERATION_ENABLED: "true", + OPENCONDITIONS_SECRETS_KEY: TEST_SECRETS_KEY, OPENCONDITIONS_INSTANCE_ID: D, OPENCONDITIONS_FEDERATION_ACTOR: JSON.stringify(actor(D)), OPENCONDITIONS_FEDERATION_PEERS: JSON.stringify([peer(A, keyA, { pull: { filter: FILTER } })]), diff --git a/services/federation/src/__tests__/backfill-route.integration.test.ts b/services/federation/src/__tests__/backfill-route.integration.test.ts index 5b36cf26c..6321b47fe 100644 --- a/services/federation/src/__tests__/backfill-route.integration.test.ts +++ b/services/federation/src/__tests__/backfill-route.integration.test.ts @@ -1,4 +1,4 @@ -import { runMigrations } from "@openconditions/core/server"; +import { runMigrations, SecretsKey } from "@openconditions/core/server"; import { generateInstanceKey, InMemoryNonceStore, @@ -8,6 +8,7 @@ import { signMessage, verifyMessage, } from "@openconditions/federation"; +import { TEST_SECRETS_KEY } from "@openconditions/test-database"; import { assertPostgisProfile, POSTGIS_IMAGES, @@ -114,6 +115,7 @@ beforeAll(async () => { enabledEnv = { OPENCONDITIONS_FEDERATION_ENABLED: "true", + OPENCONDITIONS_SECRETS_KEY: TEST_SECRETS_KEY, OPENCONDITIONS_INSTANCE_ID: ACTOR_CONFIG.instanceId, OPENCONDITIONS_FEDERATION_ACTOR: JSON.stringify(ACTOR_CONFIG), OPENCONDITIONS_FEDERATION_ARCHIVE_URL: ARCHIVE_URL, @@ -218,7 +220,7 @@ describe("GET /peer/backfill", () => { // Signed with the page: each file's hash and size. expect(page.archive).toEqual(archive); - const [key] = await loadActiveKeys(sql, NOW); + const [key] = await loadActiveKeys(sql, SecretsKey.parse(TEST_SECRETS_KEY), NOW); const verifyAs = (request: { method: string; url: string; diff --git a/services/federation/src/__tests__/inbox-route.integration.test.ts b/services/federation/src/__tests__/inbox-route.integration.test.ts index 2829a6656..47a5f7b90 100644 --- a/services/federation/src/__tests__/inbox-route.integration.test.ts +++ b/services/federation/src/__tests__/inbox-route.integration.test.ts @@ -10,7 +10,11 @@ import { unblockPeer, } from "@openconditions/federation"; import { schemaVersions } from "@openconditions/model"; -import { createTestDatabase, type TestDatabase } from "@openconditions/test-database"; +import { + createTestDatabase, + TEST_SECRETS_KEY, + type TestDatabase, +} from "@openconditions/test-database"; import type postgres from "postgres"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; import { build } from "../server.js"; @@ -80,6 +84,7 @@ beforeAll(async () => { enabledEnv = { OPENCONDITIONS_FEDERATION_ENABLED: "true", + OPENCONDITIONS_SECRETS_KEY: TEST_SECRETS_KEY, OPENCONDITIONS_INSTANCE_ID: ACTOR_CONFIG.instanceId, OPENCONDITIONS_FEDERATION_ACTOR: JSON.stringify(ACTOR_CONFIG), OPENCONDITIONS_FEDERATION_PEERS: JSON.stringify([ diff --git a/services/federation/src/__tests__/mtls-route.integration.test.ts b/services/federation/src/__tests__/mtls-route.integration.test.ts index d90273b1d..c0a7521a4 100644 --- a/services/federation/src/__tests__/mtls-route.integration.test.ts +++ b/services/federation/src/__tests__/mtls-route.integration.test.ts @@ -6,7 +6,11 @@ import { storePeerVersions, } from "@openconditions/federation"; import { schemaVersions } from "@openconditions/model"; -import { createTestDatabase, type TestDatabase } from "@openconditions/test-database"; +import { + createTestDatabase, + TEST_SECRETS_KEY, + type TestDatabase, +} from "@openconditions/test-database"; import type { FastifyRequest } from "fastify"; import type postgres from "postgres"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; @@ -82,6 +86,7 @@ beforeAll(async () => { enabledEnv = { OPENCONDITIONS_FEDERATION_ENABLED: "true", + OPENCONDITIONS_SECRETS_KEY: TEST_SECRETS_KEY, OPENCONDITIONS_INSTANCE_ID: ACTOR_CONFIG.instanceId, OPENCONDITIONS_FEDERATION_ACTOR: JSON.stringify(ACTOR_CONFIG), OPENCONDITIONS_FEDERATION_ARCHIVE_URL: ARCHIVE_URL, diff --git a/services/federation/src/__tests__/outbox-route.integration.test.ts b/services/federation/src/__tests__/outbox-route.integration.test.ts index 5fec7123f..8a916bb77 100644 --- a/services/federation/src/__tests__/outbox-route.integration.test.ts +++ b/services/federation/src/__tests__/outbox-route.integration.test.ts @@ -1,4 +1,4 @@ -import { runMigrations } from "@openconditions/core/server"; +import { runMigrations, SecretsKey } from "@openconditions/core/server"; import type { InstanceKey, RecordOutboxEntry, @@ -14,6 +14,7 @@ import { signMessage, verifyMessage, } from "@openconditions/federation"; +import { TEST_SECRETS_KEY } from "@openconditions/test-database"; import { assertPostgisProfile, POSTGIS_IMAGES, @@ -65,6 +66,7 @@ const ACTOR_CONFIG = { const ENABLED_ENV = { OPENCONDITIONS_FEDERATION_ENABLED: "true", + OPENCONDITIONS_SECRETS_KEY: TEST_SECRETS_KEY, OPENCONDITIONS_INSTANCE_ID: ACTOR_CONFIG.instanceId, OPENCONDITIONS_FEDERATION_ACTOR: JSON.stringify(ACTOR_CONFIG), }; @@ -159,7 +161,7 @@ describe("GET /peer/outbox", () => { provenance: { instanceId: "oc-test", sourceId: "nl-ndw-events" }, }); - const [key] = await loadActiveKeys(sql, NOW); + const [key] = await loadActiveKeys(sql, SecretsKey.parse(TEST_SECRETS_KEY), NOW); const verified = await verifyMessage({ method: "GET", url: OUTBOX_URL, @@ -303,7 +305,7 @@ describe("GET /peer/outbox", () => { expect(notModified.headers["etag"]).toBe(etag); expect(notModified.headers["signature"]).toBeDefined(); - const [key] = await loadActiveKeys(sql, NOW); + const [key] = await loadActiveKeys(sql, SecretsKey.parse(TEST_SECRETS_KEY), NOW); const verified = await verifyMessage({ method: "GET", url: OUTBOX_URL, @@ -371,7 +373,7 @@ describe("GET /peer/outbox", () => { expect(notModified.statusCode).toBe(304); expect(notModified.headers["signature-input"]).toContain('"etag"'); - const [key] = await loadActiveKeys(sql, NOW); + const [key] = await loadActiveKeys(sql, SecretsKey.parse(TEST_SECRETS_KEY), NOW); const headers = headerStrings(notModified.headers as Record); const tampered = await verifyMessage({ method: "GET", @@ -443,7 +445,7 @@ describe("GET /peer/outbox", () => { }); expect(tomb.record).toBeUndefined(); - const [key] = await loadActiveKeys(sql, NOW); + const [key] = await loadActiveKeys(sql, SecretsKey.parse(TEST_SECRETS_KEY), NOW); const verified = await verifyMessage({ method: "GET", url: OUTBOX_URL, @@ -590,7 +592,7 @@ describe("GET /peer/outbox — the tier-bounded public snapshot", () => { '"@method";req "@target-uri";req "signature";req', ); - const [key] = await loadActiveKeys(sql, NOW); + const [key] = await loadActiveKeys(sql, SecretsKey.parse(TEST_SECRETS_KEY), NOW); const verifyAs = (request: { method: string; url: string; diff --git a/services/federation/src/__tests__/peer-book.test.ts b/services/federation/src/__tests__/peer-book.test.ts index 57bd5ee93..fb00e6436 100644 --- a/services/federation/src/__tests__/peer-book.test.ts +++ b/services/federation/src/__tests__/peer-book.test.ts @@ -1,4 +1,5 @@ import { generateInstanceKey, type PeerRecord } from "@openconditions/federation"; +import { TEST_SECRETS_KEY } from "@openconditions/test-database"; import { describe, expect, it } from "vitest"; import { resolveFederationSettings } from "../config.js"; import { PeerBook } from "../peer-book.js"; @@ -54,6 +55,7 @@ describe("the peers a registry sync found", () => { describe("the registry settings", () => { const enabled = { OPENCONDITIONS_FEDERATION_ENABLED: "true", + OPENCONDITIONS_SECRETS_KEY: TEST_SECRETS_KEY, OPENCONDITIONS_INSTANCE_ID: "me.example.org", OPENCONDITIONS_FEDERATION_ACTOR: JSON.stringify({ instanceId: "me.example.org", diff --git a/services/federation/src/__tests__/peer-egress.test.ts b/services/federation/src/__tests__/peer-egress.test.ts index 4336fb3bc..0d39f3bce 100644 --- a/services/federation/src/__tests__/peer-egress.test.ts +++ b/services/federation/src/__tests__/peer-egress.test.ts @@ -6,12 +6,14 @@ import type { AddressInfo } from "node:net"; import { tmpdir } from "node:os"; import { join } from "node:path"; import type { TLSSocket } from "node:tls"; +import { TEST_SECRETS_KEY } from "@openconditions/test-database"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; import { resolveFederationSettings } from "../config.js"; import { peerFetch } from "../peer-egress.js"; const enabled = { OPENCONDITIONS_FEDERATION_ENABLED: "true", + OPENCONDITIONS_SECRETS_KEY: TEST_SECRETS_KEY, OPENCONDITIONS_INSTANCE_ID: "me.example.org", OPENCONDITIONS_FEDERATION_ACTOR: JSON.stringify({ instanceId: "me.example.org", diff --git a/services/federation/src/__tests__/peering.integration.test.ts b/services/federation/src/__tests__/peering.integration.test.ts index abbcfc49f..5f0445466 100644 --- a/services/federation/src/__tests__/peering.integration.test.ts +++ b/services/federation/src/__tests__/peering.integration.test.ts @@ -4,7 +4,7 @@ * outbox to B's inbox, and B lands what A publishes, the liveness of A's * sources included. Requests travel between the two apps in process. */ -import { runMigrations } from "@openconditions/core/server"; +import { runMigrations, SecretsKey } from "@openconditions/core/server"; import { createInMemoryRateLimiter, InMemoryNonceStore, @@ -22,6 +22,7 @@ import { tombstoneRecords, writeSnapshot, } from "@openconditions/storage"; +import { TEST_SECRETS_KEY } from "@openconditions/test-database"; import { assertPostgisProfile, POSTGIS_IMAGES, @@ -38,6 +39,7 @@ import { pullPeer } from "../puller.js"; import { build } from "../server.js"; import { registry } from "./record-fixtures.js"; +const secrets = SecretsKey.parse(TEST_SECRETS_KEY); const A = "a.example.org"; const B = "b.example.org"; /** Pushed only A's priority entries, and pulling A for the rest. */ @@ -195,21 +197,23 @@ beforeAll(async () => { sqlC = postgres(`${server}/c`, { max: 4, onnotice: () => {} }); const now = new Date().toISOString(); - await maintainInstanceKey(sqlA, now, A); - await maintainInstanceKey(sqlB, now, B); - await maintainInstanceKey(sqlC, now, C); - [keyA] = (await loadActiveKeys(sqlA, now)) as [InstanceKey]; - const [keyB] = (await loadActiveKeys(sqlB, now)) as [InstanceKey]; - [keyC] = (await loadActiveKeys(sqlC, now)) as [InstanceKey]; + await maintainInstanceKey(sqlA, secrets, now, A); + await maintainInstanceKey(sqlB, secrets, now, B); + await maintainInstanceKey(sqlC, secrets, now, C); + [keyA] = (await loadActiveKeys(sqlA, secrets, now)) as [InstanceKey]; + const [keyB] = (await loadActiveKeys(sqlB, secrets, now)) as [InstanceKey]; + [keyC] = (await loadActiveKeys(sqlC, secrets, now)) as [InstanceKey]; const envA = { OPENCONDITIONS_FEDERATION_ENABLED: "true", + OPENCONDITIONS_SECRETS_KEY: TEST_SECRETS_KEY, OPENCONDITIONS_INSTANCE_ID: A, OPENCONDITIONS_FEDERATION_ACTOR: JSON.stringify(actor(A)), OPENCONDITIONS_FEDERATION_PEERS: JSON.stringify([peer(B, keyB), peer(C, keyC)]), }; envC = { OPENCONDITIONS_FEDERATION_ENABLED: "true", + OPENCONDITIONS_SECRETS_KEY: TEST_SECRETS_KEY, OPENCONDITIONS_INSTANCE_ID: C, OPENCONDITIONS_FEDERATION_ACTOR: JSON.stringify(actor(C)), OPENCONDITIONS_FEDERATION_PEERS: JSON.stringify([ @@ -224,6 +228,7 @@ beforeAll(async () => { appC = await build({ sql: sqlC, env: envC, logger: false, peers: peersC }); const envB = { OPENCONDITIONS_FEDERATION_ENABLED: "true", + OPENCONDITIONS_SECRETS_KEY: TEST_SECRETS_KEY, OPENCONDITIONS_INSTANCE_ID: B, OPENCONDITIONS_FEDERATION_ACTOR: JSON.stringify(actor(B)), OPENCONDITIONS_FEDERATION_PEERS: JSON.stringify([peer(A, keyA, { subscribe: SUBSCRIBE })]), @@ -596,7 +601,7 @@ describe("a peer that pulls a backlog while it is pushed to", () => { describe("a peer that rotates its key", () => { it("is followed by its pins: the key it rotated to verifies once its peers read it", async () => { const now = new Date().toISOString(); - const rotated = await rotateInstanceKey(sqlA, now, A); + const rotated = await rotateInstanceKey(sqlA, secrets, now, A); expect(rotated.endorsement?.by).toBe(keyA.keyId); // Push a new entry under the new key before B has read A's actor document. await writeSnapshot( diff --git a/services/federation/src/__tests__/reconcile.integration.test.ts b/services/federation/src/__tests__/reconcile.integration.test.ts index 3200eafb5..a542c7e8d 100644 --- a/services/federation/src/__tests__/reconcile.integration.test.ts +++ b/services/federation/src/__tests__/reconcile.integration.test.ts @@ -10,7 +10,7 @@ import { mkdtemp, readFile, rm, writeFile } from "node:fs/promises"; import { tmpdir } from "node:os"; import path from "node:path"; import { ingestFederatedPage } from "@openconditions/contributions-api/federation/inbox"; -import { runMigrations } from "@openconditions/core/server"; +import { runMigrations, SecretsKey } from "@openconditions/core/server"; import { ensureJournalEpoch, InMemoryNonceStore, @@ -27,6 +27,7 @@ import { tombstoneRecords, writeSnapshot, } from "@openconditions/storage"; +import { TEST_SECRETS_KEY } from "@openconditions/test-database"; import { assertPostgisProfile, POSTGIS_IMAGES, @@ -316,13 +317,15 @@ beforeAll(async () => { archiveDir = await mkdtemp(path.join(tmpdir(), "oc-reconcile-test-")); const now = new Date().toISOString(); - await maintainInstanceKey(sqlA, now, A); - await maintainInstanceKey(sqlD, now, D); - const [keyA] = (await loadActiveKeys(sqlA, now)) as [InstanceKey]; - [keyD] = (await loadActiveKeys(sqlD, now)) as [InstanceKey]; + const secrets = SecretsKey.parse(TEST_SECRETS_KEY); + await maintainInstanceKey(sqlA, secrets, now, A); + await maintainInstanceKey(sqlD, secrets, now, D); + const [keyA] = (await loadActiveKeys(sqlA, secrets, now)) as [InstanceKey]; + [keyD] = (await loadActiveKeys(sqlD, secrets, now)) as [InstanceKey]; const envA = { OPENCONDITIONS_FEDERATION_ENABLED: "true", + OPENCONDITIONS_SECRETS_KEY: TEST_SECRETS_KEY, OPENCONDITIONS_INSTANCE_ID: A, OPENCONDITIONS_FEDERATION_ACTOR: JSON.stringify(actor(A)), OPENCONDITIONS_FEDERATION_PEERS: JSON.stringify([peer(D, keyD)]), @@ -330,6 +333,7 @@ beforeAll(async () => { }; const envD = { OPENCONDITIONS_FEDERATION_ENABLED: "true", + OPENCONDITIONS_SECRETS_KEY: TEST_SECRETS_KEY, OPENCONDITIONS_INSTANCE_ID: D, OPENCONDITIONS_FEDERATION_ACTOR: JSON.stringify(actor(D)), OPENCONDITIONS_FEDERATION_PEERS: JSON.stringify([peer(A, keyA, { pull: { filter: FILTER } })]), diff --git a/services/federation/src/__tests__/server.integration.test.ts b/services/federation/src/__tests__/server.integration.test.ts index 8f643ba19..b919449ed 100644 --- a/services/federation/src/__tests__/server.integration.test.ts +++ b/services/federation/src/__tests__/server.integration.test.ts @@ -1,5 +1,10 @@ +import { SecretsKey, sealSecretsKeyCheck } from "@openconditions/core/server"; import { type ActorDocument, verifyActorAgainstPin } from "@openconditions/federation"; -import { createTestDatabase, type TestDatabase } from "@openconditions/test-database"; +import { + createTestDatabase, + TEST_SECRETS_KEY, + type TestDatabase, +} from "@openconditions/test-database"; import type postgres from "postgres"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; import { build } from "../server.js"; @@ -32,6 +37,7 @@ const PEER = { const ENABLED_ENV = { OPENCONDITIONS_FEDERATION_ENABLED: "true", + OPENCONDITIONS_SECRETS_KEY: TEST_SECRETS_KEY, OPENCONDITIONS_INSTANCE_ID: ACTOR_CONFIG.instanceId, OPENCONDITIONS_FEDERATION_ACTOR: JSON.stringify(ACTOR_CONFIG), OPENCONDITIONS_FEDERATION_PEERS: JSON.stringify([PEER]), @@ -166,6 +172,59 @@ describe("federation enabled", () => { } }, 30_000); + it("fails the boot closed without a secrets key, or with one that is no key", async () => { + const { OPENCONDITIONS_SECRETS_KEY: _key, ...keyless } = ENABLED_ENV; + await expect(build({ sql, env: keyless, logger: false })).rejects.toThrow( + /OPENCONDITIONS_SECRETS_KEY is required: set OPENCONDITIONS_SECRETS_KEY_FILE/, + ); + const malformed = { ...ENABLED_ENV, OPENCONDITIONS_SECRETS_KEY: "not-a-key" }; + await expect(build({ sql, env: malformed, logger: false })).rejects.toThrow( + /OPENCONDITIONS_SECRETS_KEY must be 64 hexadecimal characters/, + ); + }, 30_000); + + it("fails the boot closed with a key that cannot open the stored instance key", async () => { + const app = await build({ sql, env: ENABLED_ENV, logger: false, now: () => NOW }); + await app.close(); + const [{ key_id: keyId }] = await sql<{ key_id: string }[]>` + SELECT key_id FROM conditions.federation_instance_key LIMIT 1`; + const wrong = { ...ENABLED_ENV, OPENCONDITIONS_SECRETS_KEY: "0f".repeat(32) }; + await expect(build({ sql, env: wrong, logger: false, now: () => NOW })).rejects.toThrow( + `wrong key: OPENCONDITIONS_SECRETS_KEY cannot decrypt conditions.federation_instance_key.private_key of the row ${keyId}`, + ); + }, 30_000); + + it("fails the boot closed with a key other than the one the ingest service sealed the key check with", async () => { + await sealSecretsKeyCheck(sql, SecretsKey.parse(TEST_SECRETS_KEY)); + try { + const app = await build({ sql, env: ENABLED_ENV, logger: false, now: () => NOW }); + await app.close(); + const other = { ...ENABLED_ENV, OPENCONDITIONS_SECRETS_KEY: "1d".repeat(32) }; + await expect(build({ sql, env: other, logger: false, now: () => NOW })).rejects.toThrow( + /OPENCONDITIONS_SECRETS_KEY differs from the key the ingest service sealed/, + ); + } finally { + await sql`TRUNCATE conditions.secrets_key_check`; + } + }, 30_000); + + it("serves the actor document from the public keys alone", async () => { + const app = await build({ sql, env: ENABLED_ENV, logger: false, now: () => NOW }); + try { + // Sealed private keys that no longer open: the public read still answers. + await sql`UPDATE conditions.federation_instance_key SET private_key_tag = ${Buffer.alloc(16)}`; + const res = await app.inject({ + method: "GET", + url: "/.well-known/openconditions/actor.json", + }); + expect(res.statusCode).toBe(200); + expect((res.json() as ActorDocument).publicKey.length).toBeGreaterThan(0); + } finally { + await app.close(); + await sql`DELETE FROM conditions.federation_instance_key`; + } + }, 30_000); + it("never serves private key material", async () => { const app = await build({ sql, env: ENABLED_ENV, logger: false, now: () => NOW }); try { diff --git a/services/federation/src/__tests__/state-route.integration.test.ts b/services/federation/src/__tests__/state-route.integration.test.ts index dd73f17df..245ff321f 100644 --- a/services/federation/src/__tests__/state-route.integration.test.ts +++ b/services/federation/src/__tests__/state-route.integration.test.ts @@ -4,7 +4,7 @@ * POST /peer/records answers for named records with the entry the journal * would carry for each now. Both behind the gates of /peer/backfill. */ -import { runMigrations } from "@openconditions/core/server"; +import { runMigrations, SecretsKey } from "@openconditions/core/server"; import { createInMemoryRateLimiter, generateInstanceKey, @@ -18,6 +18,7 @@ import { verifyMessage, } from "@openconditions/federation"; import { syncSources } from "@openconditions/storage"; +import { TEST_SECRETS_KEY } from "@openconditions/test-database"; import { assertPostgisProfile, POSTGIS_IMAGES, @@ -151,6 +152,7 @@ beforeAll(async () => { peerKey = await generateInstanceKey(new Date().toISOString()); env = { OPENCONDITIONS_FEDERATION_ENABLED: "true", + OPENCONDITIONS_SECRETS_KEY: TEST_SECRETS_KEY, OPENCONDITIONS_INSTANCE_ID: ACTOR_CONFIG.instanceId, OPENCONDITIONS_FEDERATION_ACTOR: JSON.stringify(ACTOR_CONFIG), OPENCONDITIONS_FEDERATION_ARCHIVE_URL: `${BASE_URL}/archive`, @@ -224,7 +226,7 @@ describe("GET /peer/state", () => { expect(tail.next).toBeUndefined(); // The answer is signed and bound to the request. - const [key] = await loadActiveKeys(sql, NOW); + const [key] = await loadActiveKeys(sql, SecretsKey.parse(TEST_SECRETS_KEY), NOW); const path = `/peer/state?class=situation&limit=3&${filter}`; const headers = await signedGet(path); const res = await app.inject({ method: "GET", url: path, headers }); @@ -483,7 +485,7 @@ describe("reading records in byte order of their ids", () => { heldCopiesStatement("situation", "peer.example.net", after, through), ]) { const plan = await explain(statement); - expect(plan, statement.text).toContain('"Index Name":"idx_situation_id_bytes"'); + expect(plan, statement.text).toContain('"Index Name":"situation_id_bytes_idx"'); expect(plan, statement.text).not.toContain('"Node Type":"Sort"'); } }, 60_000); diff --git a/services/federation/src/__tests__/subscription-route.integration.test.ts b/services/federation/src/__tests__/subscription-route.integration.test.ts index b2ea9f199..0c2aaeb30 100644 --- a/services/federation/src/__tests__/subscription-route.integration.test.ts +++ b/services/federation/src/__tests__/subscription-route.integration.test.ts @@ -7,6 +7,7 @@ import { SUBSCRIPTION_LEASE_SEC, signMessage, } from "@openconditions/federation"; +import { TEST_SECRETS_KEY } from "@openconditions/test-database"; import { assertPostgisProfile, POSTGIS_IMAGES, @@ -98,6 +99,7 @@ beforeAll(async () => { enabledEnv = { OPENCONDITIONS_FEDERATION_ENABLED: "true", + OPENCONDITIONS_SECRETS_KEY: TEST_SECRETS_KEY, OPENCONDITIONS_INSTANCE_ID: ACTOR_CONFIG.instanceId, OPENCONDITIONS_FEDERATION_ACTOR: JSON.stringify(ACTOR_CONFIG), OPENCONDITIONS_FEDERATION_PEERS: JSON.stringify([ diff --git a/services/federation/src/config.ts b/services/federation/src/config.ts index 24519a608..79110fba3 100644 --- a/services/federation/src/config.ts +++ b/services/federation/src/config.ts @@ -2,13 +2,14 @@ * Operator configuration for the federation service. Federation is OPT-IN * and off by default: without OPENCONDITIONS_FEDERATION_ENABLED the service * serves 404 on the well-known routes and never creates an instance key. - * When enabled, an invalid or missing actor/peers config fails the boot - * closed rather than serving a half-formed identity. + * When enabled, an invalid or missing actor/peers config, or a missing or + * malformed secrets key, fails the boot closed rather than serving a + * half-formed identity. */ import { createPrivateKey, type KeyObject, X509Certificate } from "node:crypto"; import { readFileSync } from "node:fs"; import { BlockList, isIP } from "node:net"; -import { resolveInstanceId } from "@openconditions/core/server"; +import { resolveInstanceId, type SecretsKey, secretsKeyFromEnv } from "@openconditions/core/server"; import { type ActorConfig, loadPeers, @@ -16,15 +17,32 @@ import { parseActorConfig, } from "@openconditions/federation"; -export interface FederationSettings { - enabled: boolean; - /** Present iff enabled. */ - actor?: ActorConfig; +/** The settings of a federation that is off: no identity, no key, no peers. */ +export interface DisabledFederationSettings { + enabled: false; + peers: PeerRecord[]; + actor?: undefined; + secretsKey?: undefined; + archiveUrl?: undefined; + registry?: undefined; + clientCertHeader?: undefined; + trustedProxies?: undefined; + clientCertificate?: undefined; +} + +/** The operator's federation settings; narrowing on `enabled` gives the enabled ones. */ +export type FederationSettings = DisabledFederationSettings | EnabledFederationSettings; + +export interface EnabledFederationSettings { + enabled: true; + actor: ActorConfig; + /** The key the instance keys' private halves are sealed with. */ + secretsKey: SecretsKey; /** This instance's declared peers (public metadata; empty by default). */ peers: PeerRecord[]; - /** The static GeoParquet archive URL peers fetch for beyond-window backfill. - * Present iff enabled; defaults to `${baseUrl}/archive`. */ - archiveUrl?: string; + /** The static GeoParquet archive URL peers fetch for beyond-window backfill; + * defaults to `${baseUrl}/archive`. */ + archiveUrl: string; /** The registry peers are discovered in, when one is configured. */ registry?: RegistrySettings; /** @@ -134,9 +152,13 @@ export function resolveFederationSettings( } const trustedProxies = resolveProxies(env["OPENCONDITIONS_FEDERATION_TRUSTED_PROXIES"]); const clientCertificate = resolveClientCertificate(env); + // The instance keys' private halves are sealed with it; without it no key + // can be stored or used, so an enabled federation refuses to start. + const secretsKey = secretsKeyFromEnv(env); return { enabled: true, actor, + secretsKey, peers, archiveUrl, ...(registry ? { registry } : {}), diff --git a/services/federation/src/main.ts b/services/federation/src/main.ts index 212163f0e..26505ed2c 100644 --- a/services/federation/src/main.ts +++ b/services/federation/src/main.ts @@ -1,12 +1,19 @@ /** - * Boot entry for the federation service: applies migrations, opens the - * shared postgres pool, builds the Fastify app, and listens. Tests import - * build() from server.ts instead of running this file. + * Boot entry for the federation service: takes the single-process lock, opens + * the shared postgres pool, waits until the ingest service has migrated the + * database to this build's schema version, builds the Fastify app, and + * listens. Tests import build() from server.ts instead of running this file. */ -import { assertStoredCodesRegistered, runMigrations } from "@openconditions/core/server"; +import { + assertStoredCodesRegistered, + schemaWaitTimeoutMs, + waitForSchemaVersion, + waitForSecretsKeyCheck, +} from "@openconditions/core/server"; import { advanceJournalSeenXid, + assertInstanceKeysOpen, createInMemoryRateLimiter, ensureJournalEpoch, expireSubscriptions, @@ -83,9 +90,23 @@ const EXPIRY_CYCLE_MS = 60 * 60 * 1000; async function boot() { const url = requireCredential(process.env, "DATABASE_URL"); - console.info("[federation-api] applying database migrations…"); - await runMigrations(url); - console.info("[federation-api] migrations applied"); + // A malformed timeout, and with federation enabled a missing or malformed + // secrets key or actor, fails boot before the database is read. + const schemaWaitMs = schemaWaitTimeoutMs(process.env, "OPENCONDITIONS_SCHEMA_WAIT_TIMEOUT_MS"); + const settings = resolveFederationSettings(process.env); + if (settings.enabled) { + // The actor says which protocol versions it speaks; peers negotiate on + // what it says, so one that leaves out the version this build speaks is + // worth a warning, though not a failed boot. + const { protocolVersion, protocolVersions } = settings.actor!.capabilities; + const offered = new Set([protocolVersion, ...(protocolVersions ?? [])]); + if (!offered.has(FEDERATION_PROTOCOL_VERSION)) { + console.warn( + `[federation-api] the actor offers protocol ${[...offered].join(", ")}, ` + + `not ${FEDERATION_PROTOCOL_VERSION}, the version this build speaks`, + ); + } + } let waiting = false; const lock = await holdProcessLock(url, { @@ -113,21 +134,16 @@ async function boot() { idle_in_transaction_session_timeout: 60_000, }, }); + // The ingest service migrates; this service only reads the version it reached. + await waitForSchemaVersion(sql, { + timeoutMs: schemaWaitMs, + onWait: (found, expected) => + console.info( + `[federation-api] waiting for the ingest service to migrate the database to ${expected.tag}: ${found}`, + ), + }); + console.info("[federation-api] database schema is at this build's version"); await assertStoredCodesRegistered(sql, productionRegistry(), { sourceFormats: false }); - const settings = resolveFederationSettings(process.env); - if (settings.enabled) { - // The actor says which protocol versions it speaks; peers negotiate on - // what it says, so one that leaves out the version this build speaks is - // worth a warning, though not a failed boot. - const { protocolVersion, protocolVersions } = settings.actor!.capabilities; - const offered = new Set([protocolVersion, ...(protocolVersions ?? [])]); - if (!offered.has(FEDERATION_PROTOCOL_VERSION)) { - console.warn( - `[federation-api] the actor offers protocol ${[...offered].join(", ")}, ` + - `not ${FEDERATION_PROTOCOL_VERSION}, the version this build speaks`, - ); - } - } // The journal must belong to the database's current history before anything // reads or seeds it: after a restore, a timeline change or the operator's @@ -174,10 +190,20 @@ async function boot() { // key created or rotated at boot is logged as on the timer. let keyTimer: NodeJS.Timeout | undefined; if (settings.enabled) { + // The ingest service seals the key check right after migrating; a key + // other than the ingest service's stops the boot before an instance key + // is sealed, and so does one that cannot open the stored instance keys. + await waitForSecretsKeyCheck(sql, settings.secretsKey, { + timeoutMs: schemaWaitMs, + onWait: () => + console.info("[federation-api] waiting for the ingest service to seal the key check"), + }); + await assertInstanceKeysOpen(sql, settings.secretsKey); const maintainKey = async () => { try { const kept = await maintainInstanceKey( sql, + settings.secretsKey, new Date().toISOString(), settings.actor!.instanceId, ); @@ -231,7 +257,7 @@ async function boot() { if (cycleRunning) return; cycleRunning = true; try { - const signingKey = await loadSigningKey(sql, new Date().toISOString()); + const signingKey = await loadSigningKey(sql, settings.secretsKey, new Date().toISOString()); if (!signingKey) return; const pushed = await runWebhookDeliveryCycle(sql, { signingKey, @@ -590,7 +616,7 @@ async function boot() { pullRunning = true; let again = false; try { - const signingKey = await loadSigningKey(sql, new Date().toISOString()); + const signingKey = await loadSigningKey(sql, settings.secretsKey, new Date().toISOString()); if (!signingKey) return; for (const peer of peers.all()) { if (peer.pull === undefined) continue; diff --git a/services/federation/src/peering.ts b/services/federation/src/peering.ts index 0dbea5ccf..df6179a2a 100644 --- a/services/federation/src/peering.ts +++ b/services/federation/src/peering.ts @@ -41,7 +41,8 @@ export async function refreshPeers( peers: PeerBook, opts: { fetchImpl: typeof fetch; now: string }, ): Promise { - const actor = settings.actor!; + if (!settings.enabled) return []; + const actor = settings.actor; const local = actorCapabilities(actor.capabilities, schemaVersions(productionRegistry())); const inboxUrl = `${actor.baseUrl.replace(/\/$/, "")}/peer/inbox`; const results: PeerUpkeep[] = []; @@ -54,7 +55,7 @@ export async function refreshPeers( }).catch((err: unknown) => ({ ok: false as const, reason: String(err) })); const result: PeerUpkeep = { peer: peer.instanceId, capabilities }; if (peer.subscribe !== undefined || peer.pull !== undefined) { - const signingKey = await loadSigningKey(sql, opts.now); + const signingKey = await loadSigningKey(sql, settings.secretsKey, opts.now); const keep = async ( want: Parameters[1], ): Promise => { diff --git a/services/federation/src/server.ts b/services/federation/src/server.ts index 644580b98..5fa4e171d 100644 --- a/services/federation/src/server.ts +++ b/services/federation/src/server.ts @@ -10,9 +10,11 @@ * Exported as build() so tests can fastify.inject; only main.ts listens. */ +import { verifySecretsKeyCheck } from "@openconditions/core/server"; import { ACTOR_WELL_KNOWN_PATH, anonymousRateKey, + assertInstanceKeysOpen, buildActorDocument, createInMemoryRateLimiter, FEDERATION_JSON, @@ -20,12 +22,14 @@ import { InMemoryNonceStore, type InstanceKey, loadActiveKeys, + loadActivePublicKeys, type MtlsContext, maintainInstanceKey, OUTBOX_DEFAULT_LIMIT, OUTBOX_MAX_LIMIT, outboxEtag, PEERS_WELL_KNOWN_PATH, + type PublicInstanceKey, type RateLimiter, readJournalLag, recordPeerFailure, @@ -158,21 +162,40 @@ export async function build(options: BuildOptions): Promise { return app; } - const actorConfig = settings.actor!; + const actorConfig = settings.actor; + const secretsKey = settings.secretsKey; // The running registry, not the operator, says which schemas this instance accepts. const registry = productionRegistry(); const advertisedSchemaVersions = schemaVersions(registry); const peers = options.peers ?? (await PeerBook.load(sql, settings.peers)); - await maintainInstanceKey(sql, now(), actorConfig.instanceId); + // A key other than the one the ingest service sealed the check row with + // stops the boot, and so does one that cannot open the stored instance + // keys, naming the key. An absent row is let through on purpose: the only + // callers are main.ts, which has already waited for the row with + // waitForSecretsKeyCheck, and tests that build the server on a database no + // ingest service started on. The package is private and declares no entry + // point, so no other path reaches it without that wait. + await verifySecretsKeyCheck(sql, secretsKey); + await assertInstanceKeysOpen(sql, secretsKey); + await maintainInstanceKey(sql, secretsKey, now(), actorConfig.instanceId); /** The keys valid now, rotating first when none is (a process that * outlived its keys): keys are read per request, so a rotation shows up * without a restart. */ async function activeKeys(): Promise { - const keys = await loadActiveKeys(sql, now()); + const keys = await loadActiveKeys(sql, secretsKey, now()); if (keys.length > 0) return keys; - await maintainInstanceKey(sql, now(), actorConfig.instanceId); - return loadActiveKeys(sql, now()); + await maintainInstanceKey(sql, secretsKey, now(), actorConfig.instanceId); + return loadActiveKeys(sql, secretsKey, now()); + } + + /** The public half of the keys valid now, for the actor document: no + * private key is opened for a public read. Rotates first when none is. */ + async function activePublicKeys(): Promise { + const keys = await loadActivePublicKeys(sql, now()); + if (keys.length > 0) return keys; + await maintainInstanceKey(sql, secretsKey, now(), actorConfig.instanceId); + return loadActivePublicKeys(sql, now()); } /** The key this instance signs with now. */ @@ -188,7 +211,7 @@ export async function build(options: BuildOptions): Promise { }); app.get(ACTOR_WELL_KNOWN_PATH, async (_req, reply) => { - const doc = buildActorDocument(actorConfig, await activeKeys(), advertisedSchemaVersions); + const doc = buildActorDocument(actorConfig, await activePublicKeys(), advertisedSchemaVersions); return reply.type(FEDERATION_JSON).send(JSON.stringify(doc)); }); diff --git a/services/federation/tsup.config.ts b/services/federation/tsup.config.ts index dde90af9c..a6d5358d2 100644 --- a/services/federation/tsup.config.ts +++ b/services/federation/tsup.config.ts @@ -4,8 +4,10 @@ import { defineConfig } from "tsup"; // @openconditions/core is inlined into this bundle (noExternal), so its // drizzle-kit migrations folder no longer travels with it. The main.ts entry -// runMigrations() at boot and reads those files at runtime, so copy them next -// to the bundle entry (dist/drizzle); core resolves `./drizzle` there. +// migrates nothing, but waitForSchemaVersion() reads the journal at boot for +// the version this build expects, so copy the folder next to the bundle entry +// (dist/drizzle), the same layout as the ingest image; core resolves +// `./drizzle` there. const coreDrizzle = fileURLToPath(new URL("../../packages/core/drizzle", import.meta.url)); const bundledDrizzle = fileURLToPath(new URL("./dist/drizzle", import.meta.url)); diff --git a/services/ingest-heavy/service.json b/services/ingest-heavy/service.json index bb016a7dc..df6d73fef 100644 --- a/services/ingest-heavy/service.json +++ b/services/ingest-heavy/service.json @@ -68,6 +68,12 @@ "description": "Required. PostgreSQL/PostGIS connection URL of the shared OpenMapX database for a dedicated role, e.g. postgresql://openconditions_ingest:@openmapx-postgis:5432/openmapx. Never use the PostgreSQL superuser; create the role as OpenMapX's community extensions guide describes. The service refuses to start without it.", "x-openmapx-secret": true }, + "OPENCONDITIONS_SECRETS_KEY": { + "type": "string", + "title": "Secrets key", + "description": "Required. Copy the value of openconditions-ingest's Secrets key; never generate a new one. The OAuth grant tokens this process refreshes are encrypted with it, and it refuses to start with any other key. It is not recoverable from the OpenConditions tables: the copy in your recovery set is the ingest service's.", + "x-openmapx-secret": true + }, "OPENCONDITIONS_OPERATOR_TOKEN": { "type": "string", "title": "Operator token", diff --git a/services/ingest/README.md b/services/ingest/README.md index 8957b3ca0..dd8f1ff9d 100644 --- a/services/ingest/README.md +++ b/services/ingest/README.md @@ -84,18 +84,9 @@ and of the workspace packages it depends on: read as `env["X"]` or or written as an `OPENCONDITIONS_*` or `*_CRON` name. A name built at run time escapes it. -- **Secrets** (`x-openmapx-secret`): `DATABASE_URL`, `OPENCONDITIONS_OPERATOR_TOKEN` - and the feed credentials. The operator sets each once in the admin services - panel (`openconditions-ingest`, Credentials). OpenMapX mounts it as a file and - sets `_FILE` to its path; the service reads ``, else the file - `_FILE` names. A secret has no default. A `DATABASE_URL_FILE` or - `OPENCONDITIONS_OPERATOR_TOKEN_FILE` that is set but unreadable or empty - stops the service at boot, naming the file and the cause. - - `DATABASE_URL` is required: the service refuses to start without it. On the - shared OpenMapX database it connects as the service's own role, for example - `postgresql://openconditions_ingest:@openmapx-postgis:5432/openmapx`. - Never use the PostgreSQL superuser: create the role as OpenMapX's community - extensions guide describes. +- **Secrets** (`x-openmapx-secret`): `DATABASE_URL`, `OPENCONDITIONS_SECRETS_KEY`, `OPENCONDITIONS_OPERATOR_TOKEN` and the feed credentials. The operator sets each once in the admin services panel (`openconditions-ingest`, Credentials). OpenMapX mounts it as a file and sets `_FILE` to its path; the service reads ``, else the file `_FILE` names. A secret has no default. A `DATABASE_URL_FILE` or `OPENCONDITIONS_OPERATOR_TOKEN_FILE` that is set but unreadable or empty stops the service at boot, naming the file and the cause. + - `DATABASE_URL` is required: the service refuses to start without it. On the shared OpenMapX database it connects as the service's own role, for example `postgresql://openconditions_ingest:@openmapx-postgis:5432/openmapx`. Never use the PostgreSQL superuser: create the role as OpenMapX's community extensions guide describes. + - `OPENCONDITIONS_SECRETS_KEY` is required: the OAuth2 grants' tokens are encrypted with it in the OpenConditions tables. It is 64 hexadecimal characters; generate it here, once, with `openssl rand -hex 32`, and copy the same value into the Credentials of every other OpenConditions service, the heavy-feeds process's too. After migrating, the service seals a check value with it in `conditions.secrets_key_check`, which the other services verify their copy against. The service refuses to start without it, with a malformed one, or with one that cannot decrypt a stored grant or the check value. It is not recoverable from the OpenConditions tables, and OpenMapX's vault keeps it encrypted with OpenMapX's own secrets key: keep both keys in your recovery set; see [secrets encrypted at rest](../../README.md#secrets-encrypted-at-rest). - `OPENCONDITIONS_OPERATOR_TOKEN` must equal OpenMapX's own `OPENCONDITIONS_OPERATOR_TOKEN` (its `.env`), which its `api` and `data-manager` services send as their bearer token; the two are set separately. @@ -263,11 +254,7 @@ lists, and connects a community service to its database only when its OpenMapX names `openconditions-ingest-heavy` there, enable it, with the list `nl-ndw-flow,nl-ndw-charging`: -1. On `openconditions-ingest-heavy`, set `DATABASE_URL`, the instance id and - any credential its feeds need to the primary's values, and - `OPENCONDITIONS_INGEST_FEEDS` to the list - (`SERVICE_OPENCONDITIONS_INGEST_HEAVY_OPENCONDITIONS_INGEST_FEEDS` in - OpenMapX's `.env`). +1. On `openconditions-ingest-heavy`, set `DATABASE_URL` (the primary's role: this process migrates and grants as the primary does), the instance id, the Secrets key and any credential its feeds need to the primary's values, never a newly generated key, and `OPENCONDITIONS_INGEST_FEEDS` to the list (`SERVICE_OPENCONDITIONS_INGEST_HEAVY_OPENCONDITIONS_INGEST_FEEDS` in OpenMapX's `.env`). 2. On `openconditions-ingest`, set `OPENCONDITIONS_INGEST_FEEDS_EXCLUDE` to the same list. 3. `pnpm openmapx services enable openconditions-ingest-heavy`, then @@ -434,12 +421,7 @@ egress guard refuses private addresses otherwise. ### OAuth2 logins -A feed with `oauth2-authorization-code` auth (EUMETSAT's Sentinel-3 fires) reads -an account the operator logs in once, not a key: its grant lives in -`conditions.oauth_grant`, which the service renews itself (see -[`feeds/README.md`](../../feeds/README.md#credentials)). The commands run -against `DATABASE_URL` in the image as `node dist/feed-auth.js `, in -a checkout as `pnpm --filter @openconditions/ingest feed-auth `: +A feed with `oauth2-authorization-code` auth (EUMETSAT's Sentinel-3 fires) reads an account the operator logs in once, not a key: its grant lives in `conditions.oauth_grant`, which the service renews itself (see [`feeds/README.md`](../../feeds/README.md#credentials)). Its access and refresh tokens are stored encrypted with `OPENCONDITIONS_SECRETS_KEY`. The commands run against `DATABASE_URL` with that key, both read from the container's environment, in the image as `node dist/feed-auth.js `, in a checkout as `pnpm --filter @openconditions/ingest feed-auth `: - `login ` prints the provider's login URL and asks for the authorization code the page shows after the login; paste it at once, as it diff --git a/services/ingest/service.json b/services/ingest/service.json index 5364c6de0..d6f49da98 100644 --- a/services/ingest/service.json +++ b/services/ingest/service.json @@ -71,6 +71,12 @@ "description": "Required. PostgreSQL/PostGIS connection URL of the shared OpenMapX database for a dedicated role, e.g. postgresql://openconditions_ingest:@openmapx-postgis:5432/openmapx. Never use the PostgreSQL superuser; create the role as OpenMapX's community extensions guide describes. The service refuses to start without it.", "x-openmapx-secret": true }, + "OPENCONDITIONS_SECRETS_KEY": { + "type": "string", + "title": "Secrets key", + "description": "Required. The key the OAuth grant tokens and the instance's private keys are encrypted with in the OpenConditions tables: 64 hexadecimal characters. Generate it here, once, with openssl rand -hex 32, then copy this same value into the Secrets key of every other OpenConditions service of this instance (the heavy-feeds ingest, contributions API and federation); each refuses to start with another key. It is not recoverable from the OpenConditions tables: keep a copy in your recovery set. Under OpenMapX this vault stores it encrypted with OpenMapX's own secrets key, so a database backup protects it only while that key stays out of the backup, and both keys belong in the recovery set. Losing it means logging in to every OAuth grant again and making new issuer and federation keys, which changes the federation identity. The service refuses to start without it, or with a key that cannot decrypt what is stored.", + "x-openmapx-secret": true + }, "OPENCONDITIONS_OPERATOR_TOKEN": { "type": "string", "title": "Operator token", diff --git a/services/ingest/src/__tests__/api-records.integration.test.ts b/services/ingest/src/__tests__/api-records.integration.test.ts index b34fa0cba..29e98b279 100644 --- a/services/ingest/src/__tests__/api-records.integration.test.ts +++ b/services/ingest/src/__tests__/api-records.integration.test.ts @@ -185,8 +185,8 @@ describe("GET /features", () => { }); // The box picks the features, and each one's cluster is looked up by // member: no walk over every cluster in id order. - expect(plans[0]).toMatch(/idx_feature_geom/); - expect(plans[0]).toMatch(/idx_feature_canonical_members/); + expect(plans[0]).toMatch(/feature_geom_idx/); + expect(plans[0]).toMatch(/feature_canonical_member_ids_idx/); }); it("serves the canonical view: one record per cluster, carrying its members", async () => { diff --git a/services/ingest/src/__tests__/baseline-schema.integration.test.ts b/services/ingest/src/__tests__/baseline-schema.integration.test.ts index 6dcdea1f2..5378ceeb8 100644 --- a/services/ingest/src/__tests__/baseline-schema.integration.test.ts +++ b/services/ingest/src/__tests__/baseline-schema.integration.test.ts @@ -41,3 +41,329 @@ describe("baseline schema", () => { expect(rows[0]!.free_flow_kph).toBe(110); }, 30_000); }); + +/** + * Objects not named for their table and columns alone. A partial index whose + * predicate selects rows by more than whether a column is null names that + * subset, since its columns alone would read as an index over the whole + * table; so does an index in another collation than its column's; an index on + * an expression has no columns to name; and a column list that would pass + * PostgreSQL's 63-byte identifier limit is shortened. + */ +const NAMED_BY_PURPOSE: Record = { + federation_subscription_target_key: "federation_subscription", + feature_external_ids_idx: "feature", + feature_id_bytes_idx: "feature", + feature_id_rights_revoked_idx: "feature", + observation_latest_series_key: "observation_latest", + observation_latest_value_money_fuel_price_idx: "observation_latest", + offer_id_bytes_idx: "offer", + offer_id_rights_revoked_idx: "offer", + report_evidence_merged_idx: "report_evidence", + situation_evidence_state_crowd_idx: "situation", + situation_id_bytes_idx: "situation", + situation_id_rights_revoked_idx: "situation", +}; + +const NAME_SUFFIX: Record = { p: "pkey", u: "key", f: "fkey", U: "key", i: "idx" }; + +/** The CHECKs of closed value sets, by name: each must name every value it admits. */ +const VOCABULARY_CHECKS: Record = { + segment_observation_los_check: { + table: "segment_observation", + values: ["free_flow", "heavy", "queuing", "stationary", "blocked", "unknown"], + }, + segment_speed_los_check: { + table: "segment_speed", + values: ["free_flow", "heavy", "queuing", "stationary", "blocked", "unknown"], + }, + segment_speed_confidence_check: { table: "segment_speed", values: ["measured", "estimated"] }, + record_binding_status_check: { + table: "record_binding", + values: [ + "exact", + "likely", + "ambiguous", + "unresolved", + "no_coverage", + "not_applicable", + "obsolete", + ], + }, + record_binding_direction_mode_check: { + table: "record_binding", + values: ["single", "both", "unknown"], + }, + federation_subscription_status_check: { + table: "federation_subscription", + values: ["active", "push_disabled"], + }, + federation_tombstone_reason_check: { + table: "federation_tombstone", + values: ["expired", "withdrawn", "superseded", "cancelled", "rights_revoked", "rejected"], + }, +}; + +/** Fixed-width columns first, widest alignment first, so no row pays alignment padding. */ +const COLUMN_ORDER: Record = { + observation: [ + "series_id", + "phenomenon_start", + "issued_at", + "fetched_at", + "recorded_at", + "phenomenon_end", + "result_time", + "valid_until", + "value_num", + "fetch_id", + "retention_days", + "raw_part", + "temporality", + "aggregation", + "value_money", + "value_text", + "value_json", + "quality", + "baseline", + "extra", + ], + observation_rollup_hourly: [ + "series_id", + "hour_utc", + "min", + "max", + "mean", + "sample_count", + "lineage_complete", + "contributor_receipt_ids", + "bins", + "counts", + ], + observation_latest: [ + "series_id", + "effective_from", + "since_at", + "updated_at", + "effective_until", + "expires_at", + "value_num", + "confidence_score", + "corroborations", + "retention_days", + "fused_public", + "subject_key", + "property", + "qualifier_key", + "source_id", + "subject_kind", + "access_mode", + "result_type", + "template_hash", + "feature_id", + "component_key", + "situation_id", + "crowd_record_id", + "contributor_receipt_id", + "value_money", + "value_text", + "unit", + "currency", + "fused_from", + "fused_sources", + "evidence_state", + "geom", + "reading", + "template", + ], +}; + +describe("schema conventions", () => { + it("names every constraint and index after its table and columns", async () => { + // Constraints, then the indexes that back no constraint, of the service's + // own tables (drizzle's migration journal is drizzle's). NOT NULL + // constraints (contype 'n') are left out: PostgreSQL names them itself. + const objects = await sql< + { table: string; name: string; kind: string; columns: string[]; subset: boolean }[] + >` + WITH owned AS ( + SELECT r.oid, r.relname FROM pg_class r + JOIN pg_namespace n ON n.oid = r.relnamespace + WHERE r.relkind IN ('r', 'p') AND NOT r.relispartition AND n.nspname = 'conditions' + AND r.relname <> '__drizzle_migrations') + SELECT o.relname AS table, c.conname AS name, c.contype::text AS kind, + array( + SELECT a.attname::text FROM unnest(c.conkey) WITH ORDINALITY AS k(attnum, position) + JOIN pg_attribute a ON a.attrelid = c.conrelid AND a.attnum = k.attnum + ORDER BY k.position + ) AS columns, + false AS subset + FROM pg_constraint c JOIN owned o ON o.oid = c.conrelid + WHERE c.contype IN ('p', 'u', 'f', 'c', 'x') AND c.conparentid = 0 + UNION ALL + SELECT o.relname, ix.relname, CASE WHEN i.indisunique THEN 'U' ELSE 'i' END, + array( + SELECT coalesce(a.attname::text, '') + FROM unnest((i.indkey::int2[])[0:i.indnkeyatts - 1]) WITH ORDINALITY AS k(attnum, position) + LEFT JOIN pg_attribute a ON a.attrelid = i.indrelid AND a.attnum = k.attnum + ORDER BY k.position + ), + (i.indpred IS NOT NULL + AND pg_get_expr(i.indpred, i.indrelid) !~ '^\\(?[a-z_]+ IS (NOT )?NULL\\)?$') + OR EXISTS ( + SELECT FROM unnest(i.indkey::int2[], i.indcollation::oid[]) AS k(attnum, coll) + JOIN pg_attribute a ON a.attrelid = i.indrelid AND a.attnum = k.attnum + WHERE k.coll <> 0 AND k.coll <> a.attcollation) + FROM pg_index i JOIN owned o ON o.oid = i.indrelid + JOIN pg_class ix ON ix.oid = i.indexrelid + WHERE NOT EXISTS (SELECT FROM pg_constraint c WHERE c.conindid = i.indexrelid + AND c.contype IN ('p', 'u', 'x')) + ORDER BY 1, 2`; + expect(objects.map((row) => row.table)).toEqual( + expect.arrayContaining(["observation", "observation_latest", "situation"]), + ); + const misnamed: string[] = []; + const byPurpose: string[] = []; + for (const { table, name, kind, columns, subset } of objects) { + if (kind === "c") { + if (!new RegExp(`^${table}_[a-z0-9_]+_check$`).test(name)) misnamed.push(name); + continue; + } + const suffix = NAME_SUFFIX[kind]; + const conventional = + kind === "p" ? `${table}_pkey` : `${table}_${columns.join("_")}_${suffix}`; + if (subset || columns.includes("") || conventional.length > 63) { + byPurpose.push(name); + const ok = + NAMED_BY_PURPOSE[name] === table && + name.startsWith(`${table}_`) && + name.endsWith(`_${suffix}`) && + name.length <= 63; + if (!ok) misnamed.push(`${name} (named by purpose)`); + } else if (name !== conventional) misnamed.push(`${name} -> ${conventional}`); + } + expect(misnamed).toEqual([]); + expect(byPurpose.sort()).toEqual(Object.keys(NAMED_BY_PURPOSE).sort()); + }, 30_000); + + it("generates ids by identity, never by a serial's sequence default", async () => { + const serial = await sql<{ column: string }[]>` + SELECT table_name || '.' || column_name AS column FROM information_schema.columns + WHERE table_schema = 'conditions' AND table_name <> '__drizzle_migrations' + AND column_default LIKE 'nextval(%' + ORDER BY 1`; + expect(serial).toEqual([]); + const identity = await sql<{ column: string; generation: string }[]>` + SELECT table_name || '.' || column_name AS column, identity_generation AS generation + FROM information_schema.columns + WHERE table_schema = 'conditions' AND is_identity = 'YES' + ORDER BY 1`; + expect(identity).toEqual( + [ + "federation_outbox.seq", + "observation_latest.series_id", + "report_evidence.id", + "report_refusal.id", + "source_poll_attempt.id", + ].map((column) => ({ column, generation: "BY DEFAULT" })), + ); + }, 30_000); + + it("checks every closed value set it stores", async () => { + const checks = await sql<{ name: string; table: string; definition: string }[]>` + SELECT c.conname AS name, r.relname AS table, pg_get_constraintdef(c.oid) AS definition + FROM pg_constraint c + JOIN pg_class r ON r.oid = c.conrelid + JOIN pg_namespace n ON n.oid = r.relnamespace + WHERE n.nspname = 'conditions' AND c.contype = 'c' AND c.conname = ANY(${Object.keys(VOCABULARY_CHECKS)})`; + expect(checks.map((c) => c.name).sort()).toEqual(Object.keys(VOCABULARY_CHECKS).sort()); + for (const check of checks) { + const expected = VOCABULARY_CHECKS[check.name]!; + expect(check.table).toBe(expected.table); + const admitted = [...check.definition.matchAll(/'([^']*)'::text/g)].map((m) => m[1]); + expect(admitted.sort(), check.name).toEqual([...expected.values].sort()); + } + const [coverage] = await sql<{ definition: string }[]>` + SELECT pg_get_constraintdef(oid) AS definition FROM pg_constraint + WHERE conname = 'geonet_coverage_order_check'`; + expect(coverage?.definition).toBe("CHECK ((covered_from < covered_until))"); + }, 30_000); + + it("stores fixed-width columns first in the observation tables", async () => { + const rows = await sql<{ table: string; columns: string[] }[]>` + SELECT r.relname AS table, array_agg(a.attname::text ORDER BY a.attnum) AS columns + FROM pg_attribute a + JOIN pg_class r ON r.oid = a.attrelid + JOIN pg_namespace n ON n.oid = r.relnamespace + WHERE n.nspname = 'conditions' AND r.relname = ANY(${Object.keys(COLUMN_ORDER)}) + AND a.attnum > 0 AND NOT a.attisdropped + GROUP BY r.relname`; + expect(Object.fromEntries(rows.map((r) => [r.table, r.columns]))).toEqual(COLUMN_ORDER); + }, 30_000); + + it("keeps no index that a unique constraint's leading columns already serve", async () => { + const duplicates = await sql<{ table: string; index: string; unique: string }[]>` + SELECT t.relname AS table, ix.relname AS index, ux.relname AS unique + FROM pg_index i + JOIN pg_class ix ON ix.oid = i.indexrelid + JOIN pg_class t ON t.oid = i.indrelid + JOIN pg_namespace n ON n.oid = t.relnamespace + JOIN pg_index u ON u.indrelid = i.indrelid AND u.indisunique + AND u.indexrelid <> i.indexrelid AND u.indpred IS NULL AND u.indexprs IS NULL + JOIN pg_class ux ON ux.oid = u.indexrelid + WHERE n.nspname = 'conditions' + AND NOT i.indisunique AND i.indpred IS NULL AND i.indexprs IS NULL + AND i.indnatts <= u.indnatts + AND (u.indkey::int2[])[0:i.indnatts - 1] = (i.indkey::int2[])[0:i.indnatts - 1] + AND (u.indcollation::oid[])[0:i.indnatts - 1] = (i.indcollation::oid[])[0:i.indnatts - 1] + ORDER BY 1, 2`; + expect(duplicates).toEqual([]); + // Nothing reads segment speeds by level of service, and a rebuild rewrites them all. + const losIndexes = await sql` + SELECT 1 FROM pg_index i + JOIN pg_attribute a ON a.attrelid = i.indrelid AND a.attnum = i.indkey[0] + WHERE i.indrelid = 'conditions.segment_speed'::regclass AND a.attname = 'los'`; + expect(losIndexes).toEqual([]); + }, 30_000); + + it("indexes every foreign key column", async () => { + const unindexed = await sql<{ constraint: string }[]>` + SELECT c.conname AS constraint FROM pg_constraint c + JOIN pg_namespace n ON n.oid = c.connamespace + WHERE n.nspname = 'conditions' AND c.contype = 'f' AND c.conparentid = 0 + AND NOT EXISTS (SELECT FROM pg_index i WHERE i.indrelid = c.conrelid + AND (i.indkey::int2[])[0:cardinality(c.conkey) - 1] = c.conkey) + ORDER BY 1`; + expect(unindexed).toEqual([]); + }, 30_000); + + it("indexes what the records sweep looks up on features and offers", async () => { + const indexes = await sql<{ name: string; definition: string }[]>` + SELECT indexname AS name, indexdef AS definition FROM pg_indexes + WHERE schemaname = 'conditions' AND tablename IN ('feature', 'offer') + AND indexname ~ '_(expires|tombstoned)_at_idx$' + ORDER BY 1`; + expect(indexes.map((i) => [i.name, i.definition.replace(/^.* USING /, "")])).toEqual([ + ["feature_expires_at_idx", "btree (expires_at) WHERE (tombstoned_at IS NULL)"], + ["feature_tombstoned_at_idx", "btree (tombstoned_at) WHERE (tombstoned_at IS NOT NULL)"], + ["offer_expires_at_idx", "btree (expires_at) WHERE (tombstoned_at IS NULL)"], + ["offer_tombstoned_at_idx", "btree (tombstoned_at) WHERE (tombstoned_at IS NOT NULL)"], + ]); + }, 30_000); + + it("stores each value in the type it is", async () => { + const columns = await sql<{ column: string; type: string; default: string | null }[]>` + SELECT table_name || '.' || column_name AS column, data_type AS type, + column_default AS default + FROM information_schema.columns + WHERE table_schema = 'conditions' AND (table_name, column_name) IN + (('jma_budget', 'day'), ('segment_observation', 'confidence_score'), + ('segment_observation', 'confidence'), ('smn_cap_message', 'retrieval')) + ORDER BY 1`; + expect(columns).toEqual([ + { column: "jma_budget.day", type: "date", default: null }, + { column: "segment_observation.confidence_score", type: "double precision", default: null }, + { column: "smn_cap_message.retrieval", type: "jsonb", default: null }, + ]); + }, 30_000); +}); diff --git a/services/ingest/src/__tests__/binding-metrics.integration.test.ts b/services/ingest/src/__tests__/binding-metrics.integration.test.ts index c2846560a..9db2efc5a 100644 --- a/services/ingest/src/__tests__/binding-metrics.integration.test.ts +++ b/services/ingest/src/__tests__/binding-metrics.integration.test.ts @@ -86,7 +86,6 @@ describe("binding metrics on GET /feeds/status", () => { unattempted: 0, obsolete: 0, unattemptedOrObsolete: 0, - unknownStatus: 0, exact: 1, likely: 0, ambiguous: 0, @@ -121,7 +120,6 @@ describe("binding metrics on GET /feeds/status", () => { unattempted: 0, obsolete: 0, unattemptedOrObsolete: 0, - unknownStatus: 0, exact: 1, likely: 0, ambiguous: 0, @@ -141,7 +139,6 @@ describe("binding metrics on GET /feeds/status", () => { unattempted: 0, obsolete: 0, unattemptedOrObsolete: 0, - unknownStatus: 0, exact: 1, likely: 1, ambiguous: 0, @@ -152,31 +149,6 @@ describe("binding metrics on GET /feeds/status", () => { }); }); - it("counts an unknown status toward attempted without inventing a key", async () => { - await insertSituation("weird", "de-autobahn-events"); - await insertBinding("de-autobahn-events", "weird", "something_new"); - const reader = createBindingMetricsReader(sql, 0); - const metrics = await reader(); - expect(metrics.get("de-autobahn-events")).toEqual({ - activeEvents: 4, - attempted: 4, - attemptedCurrent: 4, - unattempted: 0, - obsolete: 0, - unattemptedOrObsolete: 0, - unknownStatus: 1, - exact: 1, - likely: 1, - ambiguous: 0, - unresolved: 1, - noCoverage: 0, - notApplicable: 0, - reasons: [], - }); - await sql`UPDATE conditions.situation SET tombstoned_at = now(), tombstone_reason = 'withdrawn' - WHERE id = ${id("de-autobahn-events", "weird")}`; - }); - it("counts obsolete bindings outside attemptedCurrent", async () => { await sql`UPDATE conditions.record_binding SET status = 'obsolete' WHERE record_id = ${id("de-autobahn-events", "2")}`; diff --git a/services/ingest/src/__tests__/binding-schema.integration.test.ts b/services/ingest/src/__tests__/binding-schema.integration.test.ts index 47b0bae01..d082b35ca 100644 --- a/services/ingest/src/__tests__/binding-schema.integration.test.ts +++ b/services/ingest/src/__tests__/binding-schema.integration.test.ts @@ -87,6 +87,6 @@ describe("binding tables", () => { (record_class, record_id, status, direction_mode, resolver_version, geom_hash, record_revision, bound_at) VALUES ('event', 'x', 'exact', 'single', 'v', 'h', 1, now())`, - ).rejects.toThrow(/record_binding_record_class_enum/); + ).rejects.toThrow(/record_binding_record_class_check/); }, 30_000); }); diff --git a/services/ingest/src/__tests__/flow-lineage.integration.test.ts b/services/ingest/src/__tests__/flow-lineage.integration.test.ts index c766536c3..6dc3ccd9a 100644 --- a/services/ingest/src/__tests__/flow-lineage.integration.test.ts +++ b/services/ingest/src/__tests__/flow-lineage.integration.test.ts @@ -61,7 +61,7 @@ beforeAll(async () => { VALUES ('1:f',1,'f',ST_GeomFromText('LINESTRING(5.1 52.1,5.11 52.1)',4326),'motorway','A',1000,5,100,${NOW}), ('2:f',2,'f',ST_GeomFromText('LINESTRING(5.11 52.1,5.12 52.1)',4326),'motorway','A',1000,5,120,${NOW})`; await sql`INSERT INTO conditions.segment_observation - (segment_id,source,source_tier,current_kph,free_flow_kph,speed_ratio,los,confidence,observed_at) + (segment_id,source,source_tier,current_kph,free_flow_kph,speed_ratio,los,confidence_score,observed_at) VALUES ('1:f','child-a','authoritative',20,100,0.2,'queuing',1,${NOW}), ('1:f','sensor-b','sensor',80,100,0.8,'heavy',1,${NOW}), ('1:f','los-c','authoritative',NULL,NULL,NULL,'blocked',1,${NOW}), @@ -120,7 +120,7 @@ it("fallback LOS follows the speed snapshot and an unknown crowd source keeps it expect(row!.field_sources.los).toEqual(["parent-a"]); expect(row!.field_sources.confidence).toEqual(["parent-a"]); await sql`INSERT INTO conditions.segment_observation - (segment_id,source,source_tier,current_kph,free_flow_kph,speed_ratio,los,confidence,observed_at) + (segment_id,source,source_tier,current_kph,free_flow_kph,speed_ratio,los,confidence_score,observed_at) VALUES ('2:f','crowd','crowd',60,120,0.5,'heavy',1,${NOW})`; await captureWrittenScalars("2:f", "crowd"); await fuseSegmentSpeed(sql, () => NOW); @@ -372,7 +372,7 @@ it("does not invent precise lineage for a legacy raw non-sensor observation duri VALUES ('9:f',9,'f',ST_GeomFromText('LINESTRING(5.2 52.1,5.21 52.1)',4326),'motorway','legacy',1000,5,100,${NOW}), ('10:f',10,'f',ST_GeomFromText('LINESTRING(5.21 52.1,5.22 52.1)',4326),'motorway','legacy',1000,5,120,${NOW})`; await sql`INSERT INTO conditions.segment_observation - (segment_id,source,source_tier,current_kph,free_flow_kph,speed_ratio,los,confidence,observed_at) + (segment_id,source,source_tier,current_kph,free_flow_kph,speed_ratio,los,confidence_score,observed_at) VALUES ('9:f','child-a','authoritative',40,100,0.4,'queuing',1,${NOW})`; await fuseSegmentSpeed(sql, () => NOW); const [measured] = diff --git a/services/ingest/src/__tests__/grants.integration.test.ts b/services/ingest/src/__tests__/grants.integration.test.ts new file mode 100644 index 000000000..45e79f10a --- /dev/null +++ b/services/ingest/src/__tests__/grants.integration.test.ts @@ -0,0 +1,231 @@ +import { runMigrations } from "@openconditions/core/server"; +import { syncSources } from "@openconditions/storage"; +import { + CONTRIBUTIONS_ROLE, + contributionsRoleUrl, + createTestDatabase, + createTestRole, + type TestDatabase, + type TestRole, + TILES_OWNER_ROLE, +} from "@openconditions/test-database"; +import postgres from "postgres"; +import { afterAll, beforeAll, describe, expect, it } from "vitest"; + +/** + * Every migrate grants OpenMapX's tile role and the contributions service's + * role exactly what they use, by name, if they exist, through + * `conditions.grant_consumer_roles()`. The integration run's server has both + * roles, created after the template was migrated. + */ + +/** Each privilege a role holds in the schema conditions, as ` `. */ +async function privileges(sql: postgres.Sql, role: string): Promise { + const rows = await sql<{ grant: string }[]>` + SELECT concat_ws(' ', kind, name, privilege) AS grant FROM ( + SELECT 'schema' AS kind, n.nspname::text AS name, a.privilege_type AS privilege, a.grantee + FROM pg_namespace n CROSS JOIN LATERAL aclexplode(n.nspacl) a + WHERE n.nspname = 'conditions' + UNION ALL + SELECT CASE c.relkind WHEN 'S' THEN 'sequence' ELSE 'table' END, c.relname::text, + a.privilege_type, a.grantee + FROM pg_class c CROSS JOIN LATERAL aclexplode(c.relacl) a + WHERE c.relnamespace = 'conditions'::regnamespace + UNION ALL + SELECT 'column', c.relname || '.' || att.attname, a.privilege_type, a.grantee + FROM pg_attribute att JOIN pg_class c ON c.oid = att.attrelid + CROSS JOIN LATERAL aclexplode(att.attacl) a + WHERE c.relnamespace = 'conditions'::regnamespace + UNION ALL + SELECT 'function', p.proname || '(' || pg_get_function_identity_arguments(p.oid) || ')', + a.privilege_type, a.grantee + FROM pg_proc p CROSS JOIN LATERAL aclexplode(p.proacl) a + WHERE p.pronamespace = 'conditions'::regnamespace + ) granted + WHERE grantee = (SELECT oid FROM pg_roles WHERE rolname = ${role})`; + return rows.map((r) => r.grant).sort(); +} + +const TILE_GRANTS = [ + "function flow_osm_credit() EXECUTE", + "function flow_public_licenses(licenses text[]) EXECUTE", + "function segment_flow(z integer, x integer, y integer, query_params json) EXECUTE", + "schema conditions USAGE", + "table public_license_policy SELECT", + "table road_segment SELECT", + "table segment_speed SELECT", + "table source SELECT", +].sort(); + +/** What contributions-api's queries use; its flows test runs them with only these. */ +const CONTRIBUTIONS_GRANTS = [ + // No grant on a sequence: an identity column's default takes its next + // value with the INSERT privilege on the table alone. + "schema conditions USAGE", + ...[ + "__drizzle_migrations", + "feature", + "feature_canonical", + "feature_component", + "federation_subscription", + "observation", + "observation_rollup_progress", + "offer", + "secrets_key_check", + "source", + "source_poll_attempt", + "source_status", + ].map((table) => `table ${table} SELECT`), + "table situation_revision INSERT", + ...[ + "contributor_receipt", + "federation_outbox", + "issuer_key", + "report_evidence", + "spent_token", + "sub_claim", + ].flatMap((table) => [`table ${table} INSERT`, `table ${table} SELECT`]), + "table record_relation DELETE", + "table record_relation SELECT", + ...["report_refusal", "situation_effect"].flatMap((table) => + ["DELETE", "INSERT", "SELECT"].map((p) => `table ${table} ${p}`), + ), + ...["binding_queue", "reporter", "situation", "token_quota"].flatMap((table) => + ["INSERT", "SELECT", "UPDATE"].map((p) => `table ${table} ${p}`), + ), + ...["block_list", "observation_latest"].flatMap((table) => + ["DELETE", "INSERT", "SELECT", "UPDATE"].map((p) => `table ${table} ${p}`), + ), +].sort(); + +const databases: TestDatabase[] = []; +const roles: TestRole[] = []; +const clients: postgres.Sql[] = []; + +afterAll(async () => { + for (const client of clients.splice(0)) await client.end(); + for (const db of databases.splice(0)) await db.close(); + for (const role of roles.splice(0)) await role.drop(); +}, 30_000); + +/** A login role on `db`, kept until the suite ends. */ +async function login(db: TestDatabase): Promise<{ role: TestRole; sql: postgres.Sql }> { + const role = await createTestRole(db); + roles.push(role); + const sql = postgres(role.url, { max: 1, onnotice: () => {} }); + clients.push(sql); + return { role, sql }; +} + +/** An empty database migrated as the ingest service's role does, which owns `conditions`. */ +async function migratedAsIngest(): Promise<{ db: TestDatabase; ingest: postgres.Sql }> { + const db = await createTestDatabase({ empty: true }); + databases.push(db); + const { role, sql } = await login(db); + await db.sql`CREATE EXTENSION postgis`; + const [database] = await db.sql<{ name: string }[]>`SELECT current_database() AS name`; + await db.sql.unsafe(`GRANT CREATE ON DATABASE "${database!.name}" TO "${role.name}"`); + await runMigrations(role.url); + return { db, ingest: sql }; +} + +describe("roles created before the first migrate", () => { + let db: TestDatabase; + let ingest: postgres.Sql; + + beforeAll(async () => { + ({ db, ingest } = await migratedAsIngest()); + }, 120_000); + + it("receive exactly their grants", async () => { + expect(await privileges(db.sql, TILES_OWNER_ROLE)).toEqual(TILE_GRANTS); + expect(await privileges(db.sql, CONTRIBUTIONS_ROLE)).toEqual(CONTRIBUTIONS_GRANTS); + }); + + it("let no one but the owner run the grant function, which runs with its caller's rights", async () => { + const fn = "conditions.grant_consumer_roles()"; + expect( + await db.sql` + SELECT has_function_privilege('public', ${fn}, 'EXECUTE') AS public, + has_function_privilege(${TILES_OWNER_ROLE}, ${fn}, 'EXECUTE') AS tiles, + has_function_privilege(${CONTRIBUTIONS_ROLE}, ${fn}, 'EXECUTE') AS contributions, + p.prosecdef AS definer, p.proconfig AS config + FROM pg_proc p WHERE p.oid = ${fn}::regprocedure`, + ).toEqual([ + { + public: false, + tiles: false, + contributions: false, + definer: false, + config: ["search_path=pg_catalog, pg_temp"], + }, + ]); + // The ingest service's role owns it and calls it at every migrate. + await expect(ingest`SELECT conditions.grant_consumer_roles()`).resolves.toBeDefined(); + // The contributions role may use the schema, but not call it. + const contributions = postgres(contributionsRoleUrl(db), { max: 1, onnotice: () => {} }); + clients.push(contributions); + await expect(contributions`SELECT conditions.grant_consumer_roles()`).rejects.toMatchObject({ + code: "42501", + message: "permission denied for function grant_consumer_roles", + }); + }); + + it("segment_flow renders as a role holding only the tile grants", async () => { + // A segment with a measurement under a public licence, written as ingest writes it. + await syncSources(ingest, []); + await ingest` + INSERT INTO conditions.road_segment + (segment_id, way_id, dir, geom, highway, length_m, min_zoom, free_flow_kph, computed_at) + VALUES ('500:f', 500, 'f', ST_SetSRID(ST_GeomFromText('LINESTRING(5.1 52.1, 5.11 52.1)'), 4326), + 'motorway', 1000, 5, 100, now())`; + await ingest` + INSERT INTO conditions.segment_speed + (segment_id, current_kph, free_flow_kph, speed_ratio, los, confidence, source_tier, + contributing, is_estimated, observed_at, updated_at, permission_licenses) + VALUES ('500:f', 50, 100, 0.5, 'heavy', 'measured', 'sensor', ARRAY['test-source'], false, + now(), now(), ARRAY['CC0-1.0'])`; + // As OpenMapX serves the tile: Martin's login may call only a function in + // the schema tiles, which runs as the tile owner and calls segment_flow. + // PostGIS stays in public here, as in the plain image. + const martin = await login(db); + await db.sql.unsafe(` + CREATE SCHEMA tiles; + GRANT USAGE ON SCHEMA tiles TO "${martin.role.name}", ${TILES_OWNER_ROLE}; + CREATE FUNCTION tiles.segment_flow(z integer, x integer, y integer, query_params json) + RETURNS bytea LANGUAGE plpgsql STABLE STRICT PARALLEL SAFE SECURITY DEFINER + SET search_path = pg_catalog, public, pg_temp + AS $$ BEGIN RETURN conditions.segment_flow(z, x, y, query_params); END; $$; + ALTER FUNCTION tiles.segment_flow(integer, integer, integer, json) OWNER TO ${TILES_OWNER_ROLE}; + REVOKE ALL ON FUNCTION tiles.segment_flow(integer, integer, integer, json) FROM PUBLIC; + GRANT EXECUTE ON FUNCTION tiles.segment_flow(integer, integer, integer, json) + TO "${martin.role.name}"; + `); + const [served] = await martin.sql<{ tile: Buffer }[]>` + SELECT tiles.segment_flow(8, 131, 84, '{}') AS tile`; + const [direct] = await db.sql<{ tile: Buffer }[]>` + SELECT conditions.segment_flow(8, 131, 84, '{}') AS tile`; + expect(direct!.tile.includes("speed_ratio")).toBe(true); + expect(served!.tile).toEqual(direct!.tile); + + // Nothing outside the contract is readable to the tile owner. + await expect( + db.sql.begin(async (tx) => { + await tx.unsafe(`SET LOCAL ROLE ${TILES_OWNER_ROLE}`); + await tx`SELECT count(*) FROM conditions.reporter`; + }), + ).rejects.toMatchObject({ code: "42501" }); + }, 60_000); +}); + +it("a role created after the migrate gets its grants at the next migrate", async () => { + // The template was migrated before the roles existed; a migrate with + // nothing pending, as at the ingest service's next start, grants them. + const db = await createTestDatabase(); + databases.push(db); + expect(await privileges(db.sql, TILES_OWNER_ROLE)).toEqual([]); + expect(await privileges(db.sql, CONTRIBUTIONS_ROLE)).toEqual([]); + await runMigrations(db.url); + expect(await privileges(db.sql, TILES_OWNER_ROLE)).toEqual(TILE_GRANTS); + expect(await privileges(db.sql, CONTRIBUTIONS_ROLE)).toEqual(CONTRIBUTIONS_GRANTS); +}, 60_000); diff --git a/services/ingest/src/__tests__/hazards.integration.test.ts b/services/ingest/src/__tests__/hazards.integration.test.ts index 2834ee637..1448a3756 100644 --- a/services/ingest/src/__tests__/hazards.integration.test.ts +++ b/services/ingest/src/__tests__/hazards.integration.test.ts @@ -3,7 +3,7 @@ import { mkdtempSync, readFileSync } from "node:fs"; import { tmpdir } from "node:os"; import { join } from "node:path"; import { crc32 } from "node:zlib"; -import { runMigrations } from "@openconditions/core/server"; +import { runMigrations, SecretsKey } from "@openconditions/core/server"; import { readOutbox } from "@openconditions/federation"; import { type CatalogFeed, @@ -17,7 +17,7 @@ import { sweepRecords, syncSources, } from "@openconditions/storage"; -import type { TestDatabase } from "@openconditions/test-database"; +import { TEST_SECRETS_KEY, type TestDatabase } from "@openconditions/test-database"; import { assertPostgisProfile, POSTGIS_IMAGES, @@ -30,7 +30,7 @@ import { afterAll, beforeAll, describe, expect, it, vi } from "vitest"; import { registerApiRoutes } from "../api/routes.js"; import { registerScope } from "../api/scope.js"; import { formatOf } from "../domains.js"; -import { createOAuthGrants } from "../oauth-grants.js"; +import { createOAuthGrants, pgOAuthGrantStore } from "../oauth-grants.js"; import { publishSituations, stampAttribution } from "../pipeline/publish.js"; import { createRoleState, type RunResult, runSource } from "../pipeline/run.js"; import { createRawArchive, type RawArchive } from "../raw/archive.js"; @@ -53,6 +53,7 @@ const FIXTURES = join(import.meta.dirname, "../../../../packages/hazards/src/__t const fixture = (name: string) => readFileSync(join(FIXTURES, name)); const fixtureText = (name: string) => fixture(name).toString("utf8"); +const secretsKey = SecretsKey.parse(TEST_SECRETS_KEY); const TOKEN = "operator-token-of-the-hazards-pipeline-suite"; const OPERATOR = { authorization: `Bearer ${TOKEN}` }; @@ -659,7 +660,7 @@ describe("hazards fires, quakes and smoke through the pipeline", () => { ? notFound() : new Response(fixture(granules[granule]!), { headers: { "content-type": "text/csv" } }); }, - createOAuthGrants(sql, () => Date.parse(clock)), + createOAuthGrants(sql, secretsKey, () => Date.parse(clock)), ); const source = slstr.feed.id; const T = "2026-10-16T21:00:00.000Z"; @@ -677,11 +678,18 @@ describe("hazards fires, quakes and smoke through the pipeline", () => { SELECT last_error FROM conditions.source_status WHERE source = ${source}`; expect(status?.last_error).toContain("node dist/feed-auth.js login eumetsat"); - await sql` - INSERT INTO conditions.oauth_grant - (grant_key, refresh_token, refresh_issued_at, access_token, access_expires_at) - VALUES ('eumetsat', 'refresh-1', ${new Date(T)}, 'access-1', - ${new Date(Date.parse(T) + 8 * 3_600_000)})`; + await pgOAuthGrantStore(sql, secretsKey).locked("eumetsat", (_stored, write) => + write({ + refreshToken: "refresh-1", + refreshIssuedAt: Date.parse(T), + accessToken: "access-1", + accessExpiresAt: Date.parse(T) + 8 * 3_600_000, + rejectedAt: null, + lastError: null, + lastErrorAt: null, + updatedAt: Date.parse(T), + }), + ); const series = async () => { const [row] = await sql<{ n: number }[]>` SELECT count(*)::int AS n FROM conditions.observation_latest WHERE source_id = ${source}`; diff --git a/services/ingest/src/__tests__/migration-upgrade.integration.test.ts b/services/ingest/src/__tests__/migration-upgrade.integration.test.ts deleted file mode 100644 index d4b3147cd..000000000 --- a/services/ingest/src/__tests__/migration-upgrade.integration.test.ts +++ /dev/null @@ -1,185 +0,0 @@ -import { createHash } from "node:crypto"; -import { readFile } from "node:fs/promises"; -import path from "node:path"; -import { fileURLToPath } from "node:url"; -import { runMigrations } from "@openconditions/core/server"; -import { - createTestDatabase, - postgisProfile, - runsProfile, - type TestDatabase, -} from "@openconditions/test-database"; -import type postgres from "postgres"; -import { afterAll, beforeAll, expect, it } from "vitest"; - -let db: TestDatabase; -let sql: postgres.Sql; -let url: string; -const folder = fileURLToPath(new URL("../../../../packages/core/drizzle/", import.meta.url)); - -beforeAll(async () => { - db = await createTestDatabase({ empty: true, pool: { max: 3 } }); - sql = db.sql; - url = db.url; -}); - -afterAll(async () => { - await db?.close(); -}); - -it("upgrades a populated previous schema concurrently and never reapplies versioned function SQL", async () => { - const journal = JSON.parse(await readFile(path.join(folder, "meta/_journal.json"), "utf8")) as { - entries: { idx: number; tag: string; when: number }[]; - }; - // Install exactly the historical schema and migration journal through 0027. - // No current schema bootstrap or CREATE TABLE approximation hides upgrade gaps. - await sql`CREATE EXTENSION IF NOT EXISTS postgis`; - await sql`CREATE SCHEMA conditions`; - await sql`CREATE SCHEMA drizzle`; - await sql`CREATE TABLE drizzle.__drizzle_migrations_oc (id serial PRIMARY KEY, hash text NOT NULL, created_at bigint)`; - await sql.begin(async (tx) => { - for (const entry of journal.entries.filter((entry) => entry.idx <= 27)) { - const migration = await readFile(path.join(folder, `${entry.tag}.sql`), "utf8"); - for (const statement of migration.split("--> statement-breakpoint")) { - if (statement.trim()) await tx.unsafe(statement); - } - await tx`INSERT INTO drizzle.__drizzle_migrations_oc (hash, created_at) - VALUES (${createHash("sha256").update(migration).digest("hex")}, ${entry.when})`; - } - }); - await sql`INSERT INTO conditions.osm_road (way_id, geom, highway, region, imported_at) - VALUES (4711, ST_SetSRID(ST_MakeLine(ST_MakePoint(5, 52), ST_MakePoint(5.01, 52)), 4326), - 'primary', 'nl', now())`; - await sql`INSERT INTO conditions.observations - (id, source, source_format, domain, kind, status, geom, origin, data_updated_at, fetched_at) - VALUES ('upgrade:legacy', 'upgrade', 'native', 'roads', 'measurement', 'active', - ST_SetSRID(ST_MakePoint(5, 52), 4326), '{"kind":"feed","attribution":{"license":"CC0-1.0"}}', now(), now())`; - await sql`INSERT INTO conditions.sensor_baseline - (sensor_key, source, dow_bucket, tod_bucket, free_flow_kph, method, sample_count, computed_at) - VALUES ('upgrade:s1', 'upgrade', -1, -1, 100, 'derived', 40, now())`; - await sql`INSERT INTO conditions.sensor_segment - (sensor_key, segment_id, fraction, offset_m, matched_at) VALUES ('upgrade:s1', '4711:f', 0.5, 3, now())`; - - await Promise.all([runMigrations(url), runMigrations(url), runMigrations(url)]); - expect(await sql`SELECT way_id FROM conditions.osm_road WHERE way_id = 4711`).toHaveLength(1); - // The legacy flow store is gone; derived baselines and snaps are recomputed under the new keys. - expect(await sql`SELECT to_regclass('conditions.observations') AS t`).toEqual([{ t: null }]); - expect(await sql`SELECT subject_key FROM conditions.sensor_baseline`).toEqual([]); - expect(await sql`SELECT subject_key FROM conditions.sensor_segment`).toEqual([]); - const [count] = await sql<{ n: number; distinct_n: number }[]>` - SELECT count(*)::int AS n, count(DISTINCT created_at)::int AS distinct_n FROM drizzle.__drizzle_migrations_oc`; - expect(count).toMatchObject({ n: journal.entries.length, distinct_n: journal.entries.length }); - const [functionBefore] = await sql<{ body: string }[]>` - SELECT pg_get_functiondef('conditions.segment_flow(integer,integer,integer,json)'::regprocedure) AS body`; - expect(functionBefore!.body).toContain("ST_AsMVT"); - // The outbox journals the record tables. - const capture = await sql<{ relation: string }[]>` - SELECT tgrelid::regclass::text AS relation FROM pg_trigger - WHERE tgname = 'federation_capture' ORDER BY 1`; - expect(capture.map((t) => t.relation)).toEqual([ - "conditions.feature", - "conditions.observation_latest", - "conditions.offer", - "conditions.situation", - ]); - - // A later deployed function must survive an older migrator starting again. - await sql`CREATE OR REPLACE FUNCTION conditions.segment_flow(z integer, x integer, y integer, query_params json) - RETURNS bytea LANGUAGE sql STABLE STRICT AS 'SELECT decode(''cafe'', ''hex'')'`; - await runMigrations(url); - const [after] = await sql<{ value: string }[]>` - SELECT encode(conditions.segment_flow(0, 0, 0, '{}'::json), 'hex') AS value`; - expect(after!.value).toBe("cafe"); -}, 120_000); - -it("serializes bootstrap and migrations on a fresh database", async () => { - const fresh = await createTestDatabase({ empty: true, pool: { max: 1 } }); - try { - await Promise.all(Array.from({ length: 3 }, () => runMigrations(fresh.url))); - const journal = JSON.parse(await readFile(path.join(folder, "meta/_journal.json"), "utf8")); - const [count] = - await fresh.sql`SELECT count(*)::int AS n, count(DISTINCT created_at)::int AS distinct_n FROM drizzle.__drizzle_migrations_oc`; - expect(count).toEqual({ n: journal.entries.length, distinct_n: journal.entries.length }); - } finally { - await fresh.close(); - } -}, 120_000); - -it("upgrades seeded current main through 0097 without rewriting retained data or custom rules", async () => { - const previous = await createTestDatabase({ empty: true }); - const q = previous.sql; - try { - const journal = JSON.parse(await readFile(path.join(folder, "meta/_journal.json"), "utf8")) as { - entries: { idx: number; tag: string; when: number }[]; - }; - expect(journal.entries[98]?.tag).toBe("0098_observation_revision"); - await q`CREATE EXTENSION postgis`; - await q`CREATE SCHEMA conditions`; - await q`CREATE SCHEMA drizzle`; - await q`CREATE TABLE drizzle.__drizzle_migrations_oc (id serial PRIMARY KEY, hash text NOT NULL, created_at bigint)`; - for (const entry of journal.entries.filter((entry) => entry.idx <= 97)) { - const bytes = await readFile(path.join(folder, `${entry.tag}.sql`), "utf8"); - await q.begin(async (tx) => { - for (const statement of bytes.split("--> statement-breakpoint")) { - if (statement.trim()) await tx.unsafe(statement); - } - await tx`INSERT INTO drizzle.__drizzle_migrations_oc (hash, created_at) - VALUES (${createHash("sha256").update(bytes).digest("hex")}, ${entry.when})`; - }); - } - expect( - runsProfile((await q`SHOW server_version_num`)[0]!.server_version_num, postgisProfile()), - ).toBe(true); - await q`INSERT INTO conditions.source_status (source, freshness_window_sec, publication_revision) - VALUES ('upgrade:retained', 3600, 17)`; - await q`INSERT INTO conditions.observation_latest - (subject_key, property, source_id, subject_kind, reading, template, template_hash, - access_mode, result_type, effective_from, since_at, expires_at) - VALUES ('upgrade:station', 'weather.air_temperature', 'upgrade:retained', 'feature', - '{"value":0,"credit":"retained"}', '{"rights":"original"}', 'original', - 'bulk', 'number', now(), now(), now() + interval '1 hour')`; - await q`INSERT INTO conditions.smn_cap_message (source_id, identifier, body, retain_until) - VALUES ('upgrade:smn', 'retained', '\\x6162', now() + interval '1 hour')`; - await q`INSERT INTO conditions.geonet_coverage (source_id, covered_from, covered_until, revisions) - VALUES ('upgrade:geonet', now(), now() + interval '1 hour', '{"retained":1}')`; - await q`INSERT INTO conditions.nsw_rfs_clock (source_id, incident_id, sent, published, content, expiry) - VALUES ('upgrade:rfs', 'incident', 'sent', 'published', 'retained', 'expiry')`; - await q`CREATE TABLE conditions.upgrade_rule_probe (value integer)`; - await q`CREATE RULE retain_custom_rule AS ON UPDATE TO conditions.upgrade_rule_probe DO ALSO NOTHING`; - const tables = [ - "source_status", - "observation_latest", - "smn_cap_message", - "geonet_coverage", - "nsw_rfs_clock", - ]; - const rows = () => - Promise.all( - tables.map((table) => q.unsafe(`SELECT to_jsonb(t) AS row FROM conditions.${table} t`)), - ); - const before = await rows(); - const rules = - await q`SELECT * FROM pg_rules WHERE schemaname = 'conditions' ORDER BY tablename, rulename`; - expect(rules.some((r) => r.rulename === "retain_custom_rule")).toBe(true); - await runMigrations(previous.url); - expect(await rows()).toEqual(before); - expect( - await q`SELECT * FROM pg_rules WHERE schemaname = 'conditions' ORDER BY tablename, rulename`, - ).toEqual(rules); - await q`INSERT INTO conditions.observation_revision - (source_id, feature_id, property, measured_at, rank, signature, suppressed) - VALUES ('upgrade:eccc', 'station', 'weather.air_temperature', now(), '2', 'suppressed', true)`; - const revisions = await q`SELECT * FROM conditions.observation_revision`; - await runMigrations(previous.url); - expect(await q`SELECT * FROM conditions.observation_revision`).toEqual(revisions); - expect(await rows()).toEqual(before); - expect( - await q`SELECT * FROM pg_rules WHERE schemaname = 'conditions' ORDER BY tablename, rulename`, - ).toEqual(rules); - expect((await q`SELECT count(*)::int AS n FROM drizzle.__drizzle_migrations_oc`)[0]!.n).toBe( - journal.entries.length, - ); - } finally { - await previous.close(); - } -}, 120_000); diff --git a/services/ingest/src/__tests__/migrations.integration.test.ts b/services/ingest/src/__tests__/migrations.integration.test.ts new file mode 100644 index 000000000..de4b3efa8 --- /dev/null +++ b/services/ingest/src/__tests__/migrations.integration.test.ts @@ -0,0 +1,213 @@ +import { readFile } from "node:fs/promises"; +import { runMigrations } from "@openconditions/core/server"; +import { + createTestDatabase, + createTestRole, + type TestDatabase, +} from "@openconditions/test-database"; +import { expect, it } from "vitest"; + +const folder = new URL("../../../../packages/core/drizzle/", import.meta.url); + +async function journalLength(): Promise { + const journal = JSON.parse(await readFile(new URL("meta/_journal.json", folder), "utf8")) as { + entries: unknown[]; + }; + return journal.entries.length; +} + +/** The body a function of the custom migration is written with, between its dollar quotes. */ +async function customFunctionBody(name: string): Promise { + const sql = await readFile(new URL("0001_database_objects.sql", folder), "utf8"); + const body = new RegExp(`FUNCTION "?conditions"?\\.${name}\\([^$]*\\$\\$([\\s\\S]*?)\\$\\$`).exec( + sql, + )?.[1]; + if (body === undefined) throw new Error(`no function ${name} in the custom migration`); + return body; +} + +it("serializes bootstrap and migrations on a fresh database", async () => { + const fresh = await createTestDatabase({ empty: true, pool: { max: 1 } }); + try { + await Promise.all(Array.from({ length: 3 }, () => runMigrations(fresh.url))); + const entries = await journalLength(); + const [count] = + await fresh.sql`SELECT count(*)::int AS n, count(DISTINCT created_at)::int AS distinct_n FROM conditions.__drizzle_migrations`; + expect(count).toEqual({ n: entries, distinct_n: entries }); + } finally { + await fresh.close(); + } +}, 120_000); + +/** The tables of the `conditions` schema, partitions included. */ +async function conditionsTables(db: TestDatabase): Promise { + const rows = await db.sql<{ name: string }[]>` + SELECT relname AS name FROM pg_class + WHERE relnamespace = 'conditions'::regnamespace AND relkind IN ('r', 'p') ORDER BY 1`; + return rows.map((r) => r.name); +} + +it("migrates as a role that owns only conditions, and keeps the history there", async () => { + const db = await createTestDatabase({ empty: true }); + const ingest = await createTestRole(db); + try { + // As OpenMapX's database comes: PostGIS created by the superuser, and + // another Drizzle project's history schema this role has no access to. + await db.sql`CREATE EXTENSION postgis`; + await db.sql`CREATE SCHEMA drizzle`; + const [database] = await db.sql<{ name: string }[]>`SELECT current_database() AS name`; + await db.sql.unsafe(`GRANT CREATE ON DATABASE "${database!.name}" TO "${ingest.name}"`); + + await runMigrations(ingest.url); + + expect( + await db.sql`SELECT nspname AS schema, pg_get_userbyid(nspowner) AS owner FROM pg_namespace + WHERE nspname IN ('conditions', 'drizzle') ORDER BY 1`, + ).toEqual([ + { schema: "conditions", owner: ingest.name }, + { schema: "drizzle", owner: "oc" }, + ]); + expect( + await db.sql`SELECT count(*)::int AS n FROM pg_class + WHERE relnamespace = 'drizzle'::regnamespace`, + ).toEqual([{ n: 0 }]); + expect( + await db.sql`SELECT count(*)::int AS n FROM pg_class + WHERE relnamespace = 'conditions'::regnamespace + AND relowner <> (SELECT oid FROM pg_roles WHERE rolname = ${ingest.name})`, + ).toEqual([{ n: 0 }]); + expect(await db.sql`SELECT count(*)::int AS n FROM conditions.__drizzle_migrations`).toEqual([ + { n: await journalLength() }, + ]); + } finally { + await db.close(); + await ingest.drop(); + } +}, 120_000); + +it("migrating after the conditions schema was dropped recreates every table", async () => { + const db = await createTestDatabase(); + try { + const before = await conditionsTables(db); + expect(before).toContain("__drizzle_migrations"); + await db.sql`DROP SCHEMA conditions CASCADE`; + await runMigrations(db.url); + expect(await conditionsTables(db)).toEqual(before); + expect(await db.sql`SELECT count(*)::int AS n FROM conditions.__drizzle_migrations`).toEqual([ + { n: await journalLength() }, + ]); + } finally { + await db.close(); + } +}, 120_000); + +it("after a fresh migrate, segment_flow, the helper functions, the four capture triggers and the reporter strip exist", async () => { + const db = await createTestDatabase(); + try { + const functions = await db.sql<{ name: string }[]>` + SELECT p.proname AS name FROM pg_proc p JOIN pg_namespace n ON n.oid = p.pronamespace + WHERE n.nspname = 'conditions' ORDER BY 1`; + expect(functions.map((f) => f.name)).toEqual([ + "federation_is_own", + "federation_journal_tombstone", + "federation_may_carry", + "federation_observation_capture", + "federation_record_capture", + "federation_situation_capture", + "federation_situation_priority", + "federation_situation_snapshot", + "federation_wants", + "federation_was_shared", + "flow_credit", + "flow_credit_licensing", + "flow_credit_union", + "flow_field_sources", + "flow_known_fields", + "flow_native_field_sources", + "flow_osm_credit", + "flow_permission_union", + "flow_public_licenses", + "flow_receipt_permissions", + "flow_source_credit", + "grant_consumer_roles", + "observation_fusion_provenance", + "observation_record", + "reporter_strip_key", + "segment_flow", + ]); + // OpenMapX renders traffic tiles through this signature. + const [tile] = await db.sql<{ body: string }[]>` + SELECT pg_get_functiondef('conditions.segment_flow(integer,integer,integer,json)'::regprocedure) AS body`; + expect(tile!.body).toContain(await customFunctionBody("segment_flow")); + const capture = await db.sql<{ relation: string; fn: string }[]>` + SELECT tgrelid::regclass::text AS relation, tgfoid::regproc::text AS fn FROM pg_trigger + WHERE tgname = 'federation_capture' ORDER BY 1`; + expect(capture).toEqual([ + { relation: "conditions.feature", fn: "conditions.federation_record_capture" }, + { + relation: "conditions.observation_latest", + fn: "conditions.federation_observation_capture", + }, + { relation: "conditions.offer", fn: "conditions.federation_record_capture" }, + { relation: "conditions.situation", fn: "conditions.federation_situation_capture" }, + ]); + const strip = await db.sql<{ relation: string; fn: string }[]>` + SELECT tgrelid::regclass::text AS relation, tgfoid::regproc::text AS fn FROM pg_trigger + WHERE tgname = 'reporter_strip_key'`; + expect(strip).toEqual([ + { relation: "conditions.reporter", fn: "conditions.reporter_strip_key" }, + ]); + const [observation] = await db.sql<{ kind: string; strategy: string }[]>` + SELECT c.relkind AS kind, p.partstrat AS strategy FROM pg_class c + JOIN pg_partitioned_table p ON p.partrelid = c.oid + WHERE c.oid = 'conditions.observation'::regclass`; + expect(observation).toEqual({ kind: "p", strategy: "l" }); + expect( + await db.sql`SELECT conname FROM pg_constraint + WHERE conrelid = 'conditions.geonet_coverage'::regclass AND contype = 'c'`, + ).toEqual([{ conname: "geonet_coverage_order_check" }]); + expect(await db.sql`SELECT count(*)::int AS n FROM conditions.federation_journal`).toEqual([ + { n: 1 }, + ]); + } finally { + await db.close(); + } +}); + +it("observation_latest keeps its storage parameters", async () => { + const db = await createTestDatabase(); + try { + const [table] = await db.sql<{ options: string[] }[]>` + SELECT reloptions AS options FROM pg_class WHERE oid = 'conditions.observation_latest'::regclass`; + expect([...table!.options].sort()).toEqual([ + "autovacuum_analyze_scale_factor=2", + "autovacuum_vacuum_scale_factor=0.5", + "fillfactor=50", + "toast_tuple_target=1200", + ]); + const columns = await db.sql<{ name: string; storage: string }[]>` + SELECT attname AS name, attstorage AS storage FROM pg_attribute + WHERE attrelid = 'conditions.observation_latest'::regclass AND attname IN ('template', 'reading') + ORDER BY 1`; + expect(columns).toEqual([ + { name: "reading", storage: "m" }, + { name: "template", storage: "e" }, + ]); + } finally { + await db.close(); + } +}); + +it("a second migrate leaves a later deployed function in place", async () => { + const db = await createTestDatabase(); + try { + await db.sql`CREATE OR REPLACE FUNCTION conditions.segment_flow(z integer, x integer, y integer, query_params json) + RETURNS bytea LANGUAGE sql STABLE STRICT AS 'SELECT decode(''cafe'', ''hex'')'`; + await runMigrations(db.url); + const [after] = await db.sql<{ value: string }[]>` + SELECT encode(conditions.segment_flow(0, 0, 0, '{}'::json), 'hex') AS value`; + expect(after!.value).toBe("cafe"); + } finally { + await db.close(); + } +}); diff --git a/services/ingest/src/__tests__/oauth-grants.integration.test.ts b/services/ingest/src/__tests__/oauth-grants.integration.test.ts index add0dec2f..063f00484 100644 --- a/services/ingest/src/__tests__/oauth-grants.integration.test.ts +++ b/services/ingest/src/__tests__/oauth-grants.integration.test.ts @@ -1,8 +1,15 @@ -import type { CatalogFeed } from "@openconditions/ingest-framework"; -import { createTestDatabase, type TestDatabase } from "@openconditions/test-database"; +import { SecretsKey } from "@openconditions/core/server"; +import type { CatalogFeed, StoredGrant } from "@openconditions/ingest-framework"; +import { + createTestDatabase, + dumpHolds, + dumpTable, + TEST_SECRETS_KEY, + type TestDatabase, +} from "@openconditions/test-database"; import postgres from "postgres"; import { afterAll, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import { createOAuthGrants, pgOAuthGrantStore } from "../oauth-grants.js"; +import { assertGrantsOpen, createOAuthGrants, pgOAuthGrantStore } from "../oauth-grants.js"; import { runFeedAuthCommand } from "../ops/feed-auth.js"; import { repoFeed } from "./helpers/catalog.js"; @@ -10,13 +17,16 @@ import { repoFeed } from "./helpers/catalog.js"; * The OAuth2 grants in the database: two ingest processes that find the * access token expired together spend the refresh token once, a refused * refresh token stops the grant until a new login, and the operator's - * commands store and report a grant without ever printing a token. + * commands store and report a grant without ever printing a token. The + * tokens are stored sealed with the secrets key, never in clear. */ const HOUR = 3_600_000; const NOW = Date.parse("2026-10-16T12:00:00Z"); const KEY = "eumetsat"; const TOKEN_URL = "https://user.eumetsat.int/cas/oauth2.0/accessToken"; +const secrets = SecretsKey.parse(TEST_SECRETS_KEY); +const OTHER_KEY = SecretsKey.parse("ab".repeat(32)); let db: TestDatabase; let sql: postgres.Sql; @@ -62,12 +72,28 @@ function tokenEndpoint(answer: { status?: number; body?: unknown } = {}) { return { fn, requests }; } -async function storeGrant(over: { accessExpiresAt?: number } = {}) { - await sql` - INSERT INTO conditions.oauth_grant - (grant_key, refresh_token, refresh_issued_at, access_token, access_expires_at, updated_at) - VALUES (${KEY}, 'refresh-1', ${new Date(NOW - HOUR)}, 'access-1', - ${new Date(over.accessExpiresAt ?? NOW + 7 * HOUR)}, ${new Date(NOW - HOUR)})`; +function grant(over: Partial = {}): StoredGrant { + return { + refreshToken: "refresh-1", + refreshIssuedAt: NOW - HOUR, + accessToken: "access-1", + accessExpiresAt: NOW + 7 * HOUR, + rejectedAt: null, + lastError: null, + lastErrorAt: null, + updatedAt: NOW - HOUR, + ...over, + }; +} + +async function storeGrant(over: Partial = {}, key = KEY) { + await pgOAuthGrantStore(sql, secrets).locked(key, (_stored, write) => write(grant(over))); +} + +/** The grant's tokens as the store reads them. */ +async function storedTokens(store = pgOAuthGrantStore(sql, secrets)) { + const stored = await store.read(KEY); + return { refresh_token: stored?.refreshToken, access_token: stored?.accessToken }; } const feed = () => repoFeed("eumetsat-slstr-fires") as CatalogFeed; @@ -82,8 +108,8 @@ describe("the grants in conditions.oauth_grant", () => { it("is refreshed once by two processes that find the access token expired together", async () => { await storeGrant({ accessExpiresAt: NOW - 1 }); const endpoint = tokenEndpoint(); - const process1 = createOAuthGrants(sql, () => NOW); - const process2 = createOAuthGrants(other, () => NOW); + const process1 = createOAuthGrants(sql, secrets, () => NOW); + const process2 = createOAuthGrants(other, secrets, () => NOW); const tokens = await Promise.all([ process1.accessToken(grantRequest(endpoint.fn)), process2.accessToken(grantRequest(endpoint.fn)), @@ -91,8 +117,105 @@ describe("the grants in conditions.oauth_grant", () => { expect(tokens).toEqual(["access-2", "access-2"]); expect(endpoint.requests).toHaveLength(1); expect(endpoint.requests[0]?.get("refresh_token")).toBe("refresh-1"); - const [row] = await sql`SELECT refresh_token, access_token FROM conditions.oauth_grant`; - expect(row).toEqual({ refresh_token: "refresh-2", access_token: "access-2" }); + expect(await storedTokens()).toEqual({ refresh_token: "refresh-2", access_token: "access-2" }); + }); + + it("persists the rotated refresh token sealed, never in clear", async () => { + await storeGrant({ accessExpiresAt: NOW - 1 }); + const endpoint = tokenEndpoint(); + await createOAuthGrants(sql, secrets, () => NOW).accessToken(grantRequest(endpoint.fn)); + const dump = await dumpTable(sql, "oauth_grant"); + for (const token of ["refresh-1", "refresh-2", "access-1", "access-2"]) { + expect(dumpHolds(dump, token)).toBe(false); + } + const [row] = await sql` + SELECT octet_length(refresh_token_iv) AS iv, octet_length(refresh_token_tag) AS tag, + octet_length(access_token_iv) AS access_iv + FROM conditions.oauth_grant`; + expect(row).toEqual({ iv: 12, tag: 16, access_iv: 12 }); + expect(await storedTokens()).toEqual({ refresh_token: "refresh-2", access_token: "access-2" }); + }); + + it("reads the tokens back after a restart: a new pool and the key read anew", async () => { + await storeGrant(); + const restarted = postgres(db.url, { max: 1 }); + try { + const store = pgOAuthGrantStore(restarted, SecretsKey.parse(TEST_SECRETS_KEY)); + expect(await storedTokens(store)).toEqual({ + refresh_token: "refresh-1", + access_token: "access-1", + }); + } finally { + await restarted.end(); + } + }); + + it("stores a grant with no access token as nulls, and reads it back so", async () => { + await storeGrant({ accessToken: null, accessExpiresAt: null }); + const [row] = await sql` + SELECT access_token_ciphertext, access_token_iv, access_token_tag FROM conditions.oauth_grant`; + expect(row).toEqual({ + access_token_ciphertext: null, + access_token_iv: null, + access_token_tag: null, + }); + expect(await storedTokens()).toEqual({ refresh_token: "refresh-1", access_token: null }); + }); + + it("refuses at start a key that cannot open the stored grants, naming the grant", async () => { + await storeGrant(); + await expect(assertGrantsOpen(sql, secrets)).resolves.toBeUndefined(); + const failure = assertGrantsOpen(sql, OTHER_KEY); + await expect(failure).rejects.toThrow( + /^wrong key: OPENCONDITIONS_SECRETS_KEY cannot decrypt conditions\.oauth_grant\.refresh_token of the row eumetsat/, + ); + await expect(failure).rejects.not.toThrow(/refresh-1|access-1/); + }); + + it("does not open a token copied into another grant's row", async () => { + await storeGrant(); + await storeGrant({ refreshToken: "refresh-acme", accessToken: null }, "acme"); + await sql` + UPDATE conditions.oauth_grant AS acme SET + refresh_token_ciphertext = e.refresh_token_ciphertext, + refresh_token_iv = e.refresh_token_iv, + refresh_token_tag = e.refresh_token_tag + FROM conditions.oauth_grant AS e + WHERE acme.grant_key = 'acme' AND e.grant_key = ${KEY}`; + await expect(pgOAuthGrantStore(sql, secrets).read("acme")).rejects.toThrow( + /wrong key: .*conditions\.oauth_grant\.refresh_token of the row acme/, + ); + await expect(assertGrantsOpen(sql, secrets)).rejects.toThrow(/of the row acme/); + }); + + it("does not open an access token copied into the refresh token's columns", async () => { + await storeGrant(); + await sql` + UPDATE conditions.oauth_grant SET + refresh_token_ciphertext = access_token_ciphertext, + refresh_token_iv = access_token_iv, + refresh_token_tag = access_token_tag`; + await expect(pgOAuthGrantStore(sql, secrets).read(KEY)).rejects.toThrow( + /wrong key: .*conditions\.oauth_grant\.refresh_token of the row eumetsat/, + ); + }); + + it("refuses an IV or tag of the wrong length, or a token stored only in part", async () => { + const value = Buffer.alloc(16); + await expect( + sql` + INSERT INTO conditions.oauth_grant + (grant_key, refresh_token_ciphertext, refresh_token_iv, refresh_token_tag, + refresh_issued_at) + VALUES ('short', ${value}, ${Buffer.alloc(11)}, ${value}, now())`, + ).rejects.toThrow(/oauth_grant_refresh_token_check/); + await expect( + sql` + INSERT INTO conditions.oauth_grant + (grant_key, refresh_token_ciphertext, refresh_token_iv, refresh_token_tag, + refresh_issued_at, access_token_ciphertext) + VALUES ('partial', ${value}, ${Buffer.alloc(12)}, ${value}, now(), ${value})`, + ).rejects.toThrow(/oauth_grant_access_token_check/); }); it("stops a grant whose refresh token is refused until it is logged in again", async () => { @@ -100,20 +223,15 @@ describe("the grants in conditions.oauth_grant", () => { const endpoint = tokenEndpoint({ status: 400, body: { error: "invalid_grant" } }); const login = 'log in with "node dist/feed-auth.js login eumetsat" in the ingest container'; await expect( - createOAuthGrants(sql, () => NOW).accessToken(grantRequest(endpoint.fn)), + createOAuthGrants(sql, secrets, () => NOW).accessToken(grantRequest(endpoint.fn)), ).rejects.toThrow(login); await expect( - createOAuthGrants(other, () => NOW).accessToken(grantRequest(endpoint.fn)), + createOAuthGrants(other, secrets, () => NOW).accessToken(grantRequest(endpoint.fn)), ).rejects.toThrow(login); expect(endpoint.requests).toHaveLength(1); - const [row] = await sql` - SELECT refresh_token, access_token, rejected_at, last_error FROM conditions.oauth_grant`; - expect(row).toEqual({ - refresh_token: "refresh-1", - access_token: null, - rejected_at: new Date(NOW), - last_error: "HTTP 400 invalid_grant", - }); + expect(await storedTokens()).toEqual({ refresh_token: "refresh-1", access_token: null }); + const [row] = await sql`SELECT rejected_at, last_error FROM conditions.oauth_grant`; + expect(row).toEqual({ rejected_at: new Date(NOW), last_error: "HTTP 400 invalid_grant" }); }); }); @@ -123,8 +241,8 @@ describe("feed-auth", () => { const asked: { question: string; secret: boolean }[] = []; const code = await runFeedAuthCommand(args, { feeds: [feed()], - grants: createOAuthGrants(sql, () => NOW), - store: pgOAuthGrantStore(sql), + grants: createOAuthGrants(sql, secrets, () => NOW), + store: pgOAuthGrantStore(sql, secrets), fetch: fetchFn, ask: async (question, opts) => { asked.push({ question, secret: opts.secret }); @@ -152,8 +270,8 @@ describe("feed-auth", () => { refresh_token: "refresh-elsewhere", client_id: "api-public-auth-code", }); - const [row] = await sql`SELECT refresh_token, access_token FROM conditions.oauth_grant`; - expect(row).toEqual({ refresh_token: "refresh-2", access_token: "access-2" }); + expect(await storedTokens()).toEqual({ refresh_token: "refresh-2", access_token: "access-2" }); + expect(dumpHolds(await dumpTable(sql, "oauth_grant"), "refresh-2")).toBe(false); expect(lines[0]).toBe("stored eumetsat"); expect(lines.join("\n")).toMatch(/access token valid until .* \(8 h 0 min left\)/); expect(lines.join("\n")).not.toMatch(/refresh-|access-\d/); @@ -170,8 +288,8 @@ describe("feed-auth", () => { const lines: string[] = []; const code = await runFeedAuthCommand(["login", KEY], { feeds: [feed()], - grants: createOAuthGrants(sql), - store: pgOAuthGrantStore(sql), + grants: createOAuthGrants(sql, secrets), + store: pgOAuthGrantStore(sql, secrets), fetch: endpoint.fn, ask: async () => `https://api.eumetsat.int/cli#code=OC-42&state=${state}`, out: (line) => { @@ -189,8 +307,7 @@ describe("feed-auth", () => { expect(sent.get("grant_type")).toBe("authorization_code"); expect(sent.get("code")).toBe("OC-42"); expect(sent.get("code_verifier")).toMatch(/^[A-Za-z0-9_-]{64}$/); - const [row] = await sql`SELECT refresh_token FROM conditions.oauth_grant`; - expect(row).toEqual({ refresh_token: "refresh-2" }); + expect((await storedTokens()).refresh_token).toBe("refresh-2"); }); it("refuses a pasted redirect of another login, and an unknown grant", async () => { diff --git a/services/ingest/src/__tests__/osm-direction-upgrade.integration.test.ts b/services/ingest/src/__tests__/osm-direction-upgrade.integration.test.ts deleted file mode 100644 index 885c98d74..000000000 --- a/services/ingest/src/__tests__/osm-direction-upgrade.integration.test.ts +++ /dev/null @@ -1,102 +0,0 @@ -import { createHash } from "node:crypto"; -import { readFile } from "node:fs/promises"; -import { runMigrations } from "@openconditions/core/server"; -import { createTestDatabase } from "@openconditions/test-database"; -import type postgres from "postgres"; -import { expect, it } from "vitest"; -import { activateRoadGraph } from "../pipeline/graph-state.js"; -import { importOsmRoads, osmRegionImportProvenance } from "../pipeline/osm-import.js"; -import { buildSegments } from "../pipeline/segment-build.js"; - -it("invalidates a populated legacy graph and requires reacquisition before activation", async () => { - const db = await createTestDatabase({ empty: true }); - const sql = db.sql; - const folder = new URL("../../../../packages/core/drizzle/", import.meta.url); - const region = { - id: "nl", - bbox: [4.9, 51.9, 5.2, 52.1] as [number, number, number, number], - tz: "Europe/Amsterdam", - }; - const now = () => "2026-11-23T12:00:00Z"; - const env = { SEGMENT_REGIONS: JSON.stringify([region]) }; - try { - const journal = JSON.parse(await readFile(new URL("meta/_journal.json", folder), "utf8")) as { - entries: { idx: number; tag: string; when: number }[]; - }; - await sql`CREATE EXTENSION IF NOT EXISTS postgis`; - await sql`CREATE SCHEMA conditions`; - await sql`CREATE SCHEMA drizzle`; - await sql`CREATE TABLE drizzle.__drizzle_migrations_oc (id serial PRIMARY KEY, hash text NOT NULL, created_at bigint)`; - await sql.begin(async (tx) => { - for (const entry of journal.entries.filter((entry) => entry.idx <= 104)) { - const migration = await readFile(new URL(`${entry.tag}.sql`, folder), "utf8"); - for (const statement of migration.split("--> statement-breakpoint")) { - if (statement.trim()) await tx.unsafe(statement); - } - await tx`INSERT INTO drizzle.__drizzle_migrations_oc (hash,created_at) - VALUES (${createHash("sha256").update(migration).digest("hex")}, ${entry.when})`; - } - }); - const legacy = { ...osmRegionImportProvenance(region) }; - delete legacy["way_direction_version"]; - const hash = createHash("sha256").update(JSON.stringify(legacy)).digest("hex"); - await sql`INSERT INTO conditions.osm_road (way_id,geom,highway,oneway,region,imported_at,import_config_hash,import_provenance) - VALUES (9,ST_SetSRID(ST_MakeLine(ST_MakePoint(5,52),ST_MakePoint(5.1,52)),4326),'primary',true,'nl',${now()},${hash},${sql.json(legacy as postgres.JSONValue)})`; - await sql`INSERT INTO conditions.road_graph_state - (singleton,generation,status,regions,highway_classes,pbf_provenance,imported_at,activated_at) - VALUES (true,'legacy','ready',${sql.json([region])},'[]','[]',${now()},${now()})`; - await sql`INSERT INTO conditions.record_binding - (record_class,record_id,effect_id,status,confidence,direction_mode,resolver_version, - geom_hash,record_revision,graph_generation,bound_at) - VALUES ('situation','legacy:binding','','exact',1,'single','legacy','legacy',1,'legacy',${now()})`; - const before = - await sql`SELECT way_id,ST_AsEWKB(geom) AS geom,oneway,import_config_hash,import_provenance FROM conditions.osm_road`; - await runMigrations(db.url); - expect(await sql`SELECT generation,status FROM conditions.road_graph_state`).toEqual([ - { generation: "legacy", status: "rebuilding" }, - ]); - expect(await sql`SELECT status,graph_generation FROM conditions.record_binding`).toEqual([ - { status: "obsolete", graph_generation: "legacy" }, - ]); - expect( - await sql`SELECT way_id,ST_AsEWKB(geom) AS geom,oneway,import_config_hash,import_provenance FROM conditions.osm_road`, - ).toEqual(before); - expect(await sql`SELECT oneway_reversed FROM conditions.osm_road`).toEqual([ - { oneway_reversed: false }, - ]); - await buildSegments(sql, now); - await expect(activateRoadGraph(sql, { now, env })).rejects.toThrow( - /missing current configured imports/, - ); - await importOsmRoads(sql, { - now, - regions: [region], - source: { - fetchRegion: async () => [ - { - wayId: 9, - coords: [ - [5, 52], - [5.1, 52], - ], - highway: "primary", - oneway: true, - onewayReversed: true, - }, - ], - }, - }); - await buildSegments(sql, now); - await activateRoadGraph(sql, { now, env, generation: "corrected" }); - expect(await sql`SELECT segment_id FROM conditions.road_segment`).toEqual([ - { segment_id: "9:b" }, - ]); - // Subsequent boots must not invalidate an already repaired generation. - await runMigrations(db.url); - expect(await sql`SELECT generation,status FROM conditions.road_graph_state`).toEqual([ - { generation: "corrected", status: "ready" }, - ]); - } finally { - await db.close(); - } -}, 120_000); diff --git a/services/ingest/src/__tests__/registry-coverage.integration.test.ts b/services/ingest/src/__tests__/registry-coverage.integration.test.ts index ef84ae4bd..99e81ebb1 100644 --- a/services/ingest/src/__tests__/registry-coverage.integration.test.ts +++ b/services/ingest/src/__tests__/registry-coverage.integration.test.ts @@ -41,7 +41,7 @@ describe("kernel-closed CHECK constraints", () => { insertRecord("feature", "oc:feature:nl-ndw-flow:bad", "measurement_site", { privacyClass: "bogus", }), - ).rejects.toThrow(/feature_privacy_class_enum/); + ).rejects.toThrow(/feature_privacy_class_check/); await sql`DELETE FROM conditions.feature`; }, 60_000); }); diff --git a/services/ingest/src/__tests__/role-jobs.test.ts b/services/ingest/src/__tests__/role-jobs.test.ts index fc01a9182..79a22486b 100644 --- a/services/ingest/src/__tests__/role-jobs.test.ts +++ b/services/ingest/src/__tests__/role-jobs.test.ts @@ -1,5 +1,7 @@ +import { SecretsKey } from "@openconditions/core/server"; import { productionRegistry } from "@openconditions/model-registry"; import * as storage from "@openconditions/storage"; +import { TEST_SECRETS_KEY } from "@openconditions/test-database"; import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; import { FeedStatusStore } from "../feed-status.js"; import { rebindOnBoot } from "../pipeline/rebind.js"; @@ -87,6 +89,7 @@ describe("the scheduler", () => { startScheduler(sql, maintenanceSql, new FeedStatusStore(), REPO_CATALOG, { feeds: [], primary, + secretsKey: SecretsKey.parse(TEST_SECRETS_KEY), }); it("runs the segment refresh, poll-history pruning and boot rebind on the primary", async () => { diff --git a/services/ingest/src/__tests__/secrets-boot.integration.test.ts b/services/ingest/src/__tests__/secrets-boot.integration.test.ts new file mode 100644 index 000000000..a35d4c5b2 --- /dev/null +++ b/services/ingest/src/__tests__/secrets-boot.integration.test.ts @@ -0,0 +1,109 @@ +import { SecretsKey } from "@openconditions/core/server"; +import { + createTestDatabase, + TEST_SECRETS_KEY, + type TestDatabase, +} from "@openconditions/test-database"; +import { afterAll, beforeAll, beforeEach, describe, expect, it } from "vitest"; +import { pgOAuthGrantStore } from "../oauth-grants.js"; +import { checkIngestSecrets, readIngestSecretsKey } from "../secrets-boot.js"; + +/** + * The ingest service's start: the key is read before the migrations, and + * after them the key check is sealed and every stored grant opened. + */ + +let db: TestDatabase; + +beforeAll(async () => { + db = await createTestDatabase(); +}, 120_000); + +afterAll(async () => { + await db?.close(); +}, 30_000); + +beforeEach(async () => { + await db.sql`TRUNCATE conditions.secrets_key_check, conditions.oauth_grant, + conditions.issuer_key, conditions.federation_instance_key`; +}); + +/** Stores a private key sealed with `key` in `table`, as its service does. */ +async function storePrivateKey( + table: "issuer_key" | "federation_instance_key", + key: SecretsKey, +): Promise { + const sealed = key.seal("private key", { table, column: "private_key", row: "k1" }); + const row = { + key_id: "k1", + public_key: Buffer.from("public key"), + private_key_ciphertext: Buffer.from(sealed.ciphertext), + private_key_iv: Buffer.from(sealed.iv), + private_key_tag: Buffer.from(sealed.tag), + not_before: new Date(), + not_after: new Date(Date.now() + 86_400_000), + ...(table === "federation_instance_key" ? { multibase: "z", created_at: new Date() } : {}), + }; + await db.sql`INSERT INTO ${db.sql(`conditions.${table}`)} ${db.sql(row)}`; +} + +describe("the ingest service's start", () => { + it("refuses a missing or malformed key before touching the database", () => { + expect(() => readIngestSecretsKey({})).toThrow( + /OPENCONDITIONS_SECRETS_KEY is required: set OPENCONDITIONS_SECRETS_KEY_FILE/, + ); + expect(() => readIngestSecretsKey({ OPENCONDITIONS_SECRETS_KEY: "short" })).toThrow( + /must be 64 hexadecimal characters/, + ); + }); + + it("starts with its key, sealing the key check once", async () => { + const key = readIngestSecretsKey({ OPENCONDITIONS_SECRETS_KEY: TEST_SECRETS_KEY }); + await checkIngestSecrets(db.sql, key); + await checkIngestSecrets(db.sql, key); + expect(await db.sql`SELECT id FROM conditions.secrets_key_check`).toEqual([{ id: 1 }]); + }); + + it("refuses a key other than the one the key check was sealed with", async () => { + await checkIngestSecrets(db.sql, SecretsKey.parse(TEST_SECRETS_KEY)); + await expect(checkIngestSecrets(db.sql, SecretsKey.parse("c3".repeat(32)))).rejects.toThrow( + /OPENCONDITIONS_SECRETS_KEY differs from the key the ingest service sealed/, + ); + }); + + it("refuses a key that cannot open a stored grant, naming the grant", async () => { + const key = SecretsKey.parse(TEST_SECRETS_KEY); + await pgOAuthGrantStore(db.sql, key).locked("eumetsat", (_stored, write) => + write({ + refreshToken: "refresh-1", + refreshIssuedAt: Date.now(), + accessToken: null, + accessExpiresAt: null, + rejectedAt: null, + lastError: null, + lastErrorAt: null, + updatedAt: Date.now(), + }), + ); + // No key check yet: the grant refuses the key, which seals no check row. + await expect(checkIngestSecrets(db.sql, SecretsKey.parse("c3".repeat(32)))).rejects.toThrow( + /^wrong key: .*conditions\.oauth_grant\.refresh_token of the row eumetsat/, + ); + expect(await db.sql`SELECT id FROM conditions.secrets_key_check`).toEqual([]); + await expect(checkIngestSecrets(db.sql, key)).resolves.toBeUndefined(); + }); + + it.each(["issuer_key", "federation_instance_key"] as const)( + "refuses a key that cannot open a stored %s, sealing no check row", + async (table) => { + const key = SecretsKey.parse(TEST_SECRETS_KEY); + await storePrivateKey(table, key); + // The check row is gone, as after a hand delete: the stored key still refuses another key. + await expect(checkIngestSecrets(db.sql, SecretsKey.parse("c3".repeat(32)))).rejects.toThrow( + new RegExp(`^wrong key: .*conditions\\.${table}\\.private_key of the row k1`), + ); + expect(await db.sql`SELECT id FROM conditions.secrets_key_check`).toEqual([]); + await expect(checkIngestSecrets(db.sql, key)).resolves.toBeUndefined(); + }, + ); +}); diff --git a/services/ingest/src/__tests__/segment-profile-schema.integration.test.ts b/services/ingest/src/__tests__/segment-profile-schema.integration.test.ts index f1d13fdb2..783cad7c3 100644 --- a/services/ingest/src/__tests__/segment-profile-schema.integration.test.ts +++ b/services/ingest/src/__tests__/segment-profile-schema.integration.test.ts @@ -43,10 +43,10 @@ describe("segment_profile schema", () => { expect(pk.map((r) => r.column_name)).toEqual(["segment_id", "dow", "tod_hour"]); }, 30_000); - it("has the idx_segment_profile_segment index on segment_id", async () => { + it("reads by segment through the primary key alone", async () => { const idx = await sql`SELECT indexname FROM pg_indexes WHERE schemaname='conditions' AND tablename='segment_profile'`; - expect(idx.map((i) => i.indexname)).toContain("idx_segment_profile_segment"); + expect(idx).toHaveLength(1); }, 30_000); it("round-trips a segment_profile row", async () => { diff --git a/services/ingest/src/__tests__/segment-schema.integration.test.ts b/services/ingest/src/__tests__/segment-schema.integration.test.ts index 441b7bcbb..bbd13f635 100644 --- a/services/ingest/src/__tests__/segment-schema.integration.test.ts +++ b/services/ingest/src/__tests__/segment-schema.integration.test.ts @@ -31,7 +31,7 @@ describe("segment schema", () => { ); const idx = await sql`SELECT indexname FROM pg_indexes WHERE schemaname='conditions' AND tablename='road_segment'`; - expect(idx.map((i) => i.indexname)).toContain("idx_road_segment_geom"); + expect(idx.map((i) => i.indexname)).toContain("road_segment_geom_idx"); }, 30_000); it("creates osm_road with a bigint primary key", async () => { diff --git a/services/ingest/src/__tests__/segment-speed-schema.integration.test.ts b/services/ingest/src/__tests__/segment-speed-schema.integration.test.ts index 9125acee1..9f5c4448a 100644 --- a/services/ingest/src/__tests__/segment-speed-schema.integration.test.ts +++ b/services/ingest/src/__tests__/segment-speed-schema.integration.test.ts @@ -23,7 +23,7 @@ describe("segment_observation + segment_speed schema", () => { "segment_id", "source", "source_tier", - "confidence", + "confidence_score", "sample_count", "observed_at", "expires_at", @@ -43,10 +43,11 @@ describe("segment_observation + segment_speed schema", () => { const idx = await sql`SELECT indexname FROM pg_indexes WHERE schemaname='conditions' AND tablename='segment_observation'`; - expect(idx.map((i) => i.indexname)).toContain("idx_segment_observation_segment"); + // The primary key leads with segment_id, so it serves reads by segment. + expect(idx).toHaveLength(1); }, 30_000); - it("creates segment_speed with the fused/propagated surface columns and the LOS index", async () => { + it("creates segment_speed with the fused/propagated surface columns", async () => { const cols = await sql`SELECT column_name FROM information_schema.columns WHERE table_schema='conditions' AND table_name='segment_speed'`; expect(cols.map((c) => c.column_name)).toEqual( @@ -67,7 +68,8 @@ describe("segment_observation + segment_speed schema", () => { const idx = await sql`SELECT indexname FROM pg_indexes WHERE schemaname='conditions' AND tablename='segment_speed'`; - expect(idx.map((i) => i.indexname)).toContain("idx_segment_speed_los"); + // Nothing reads segment speeds by level of service. + expect(idx.map((i) => i.indexname)).toEqual(["segment_speed_pkey"]); }, 30_000); it("round-trips a segment_observation row feeding a segment_speed row (contributing text[])", async () => { @@ -80,7 +82,7 @@ describe("segment_observation + segment_speed schema", () => { await sql` INSERT INTO conditions.segment_observation - (segment_id, source, source_tier, current_kph, free_flow_kph, speed_ratio, los, confidence, sample_count, observed_at, expires_at) + (segment_id, source, source_tier, current_kph, free_flow_kph, speed_ratio, los, confidence_score, sample_count, observed_at, expires_at) VALUES ('999:f', 'fi', 'sensor', 80.0, 100.0, 0.8, 'heavy', 0.9, NULL, now(), now() + interval '10 minutes')`; const obs = await sql<{ segment_id: string; source: string }[]>` diff --git a/services/ingest/src/__tests__/segment-speed.integration.test.ts b/services/ingest/src/__tests__/segment-speed.integration.test.ts index f7f6cf6f3..85a211343 100644 --- a/services/ingest/src/__tests__/segment-speed.integration.test.ts +++ b/services/ingest/src/__tests__/segment-speed.integration.test.ts @@ -101,7 +101,7 @@ async function seedObservation( ): Promise { await sql` INSERT INTO conditions.segment_observation - (segment_id, source, source_tier, current_kph, free_flow_kph, speed_ratio, los, confidence, sample_count, observed_at, expires_at) + (segment_id, source, source_tier, current_kph, free_flow_kph, speed_ratio, los, confidence_score, sample_count, observed_at, expires_at) VALUES (${segmentId}, ${source}, ${sourceTier}, ${currentKph}, 100, ${currentKph / 100}, 'heavy', 0.9, 1, ${observedAt}, ${expiresAt})`; } diff --git a/services/ingest/src/__tests__/smn-generation.integration.test.ts b/services/ingest/src/__tests__/smn-generation.integration.test.ts index 8bc15b865..ba0753106 100644 --- a/services/ingest/src/__tests__/smn-generation.integration.test.ts +++ b/services/ingest/src/__tests__/smn-generation.integration.test.ts @@ -268,7 +268,7 @@ for (const order of [ const rows = () => db.sql`SELECT id, record FROM conditions.situation WHERE source_id=${feed.id} AND tombstoned_at IS NULL ORDER BY id`; const durable = () => - db.sql`SELECT identifier, body, retain_until FROM conditions.smn_cap_message WHERE source_id=${feed.id} ORDER BY identifier`; + db.sql`SELECT identifier, body, retain_until FROM conditions.smn_cap_message WHERE source_id=${feed.id} ORDER BY identifier, variant`; registerScope(app, "test-operator-token-351-collision"); registerApiRoutes(app, db.sql, { registry, now: () => new Date(at), catalog: REPO_CATALOG }); try { @@ -359,35 +359,6 @@ for (const order of [ }); } -it("upgrades the existing one-ID durable table without changing its original bytes or retention claim", async () => { - const db = await createTestDatabase(); - try { - await db.sql`DROP TABLE conditions.smn_cap_decision`; - await db.sql`DROP TABLE conditions.smn_cap_message`; - const migrations = new URL("../../../../packages/core/drizzle/", import.meta.url); - await db.sql.unsafe(readFileSync(new URL("0094_smn_cap_message.sql", migrations), "utf8")); - const original = readFileSync(new URL("ar-000.xml", dir)); - const alert = readCapXml(original, true); - await db.sql`INSERT INTO conditions.smn_cap_message(source_id,identifier,body,retain_until) VALUES ('legacy',${alert.identifier},${original},'2026-11-15T23:13:22Z')`; - const migration = readFileSync(new URL("0095_glorious_adam_destine.sql", migrations), "utf8"); - for (const statement of migration.split("--> statement-breakpoint")) - await db.sql.unsafe(statement); - const rows = - await db.sql`SELECT identifier,variant,body,retrieval,retain_until FROM conditions.smn_cap_message`; - expect(rows).toHaveLength(1); - expect(rows[0]!.identifier).toBe(alert.identifier); - expect(rows[0]!.body).toEqual(original); - expect(rows[0]!.retrieval).toEqual({ legacy: true }); - expect(rows[0]!.retain_until.toISOString()).toBe("2026-11-15T23:13:22.000Z"); - expect(rows[0]!.variant).toBe(createHash("sha256").update(original).digest("hex")); - const sibling = readFileSync(new URL("ar-011.xml", dir)); - await db.sql`INSERT INTO conditions.smn_cap_message(source_id,identifier,body,retain_until) VALUES ('legacy',${alert.identifier},${sibling},'2026-11-15T23:13:22Z')`; - expect(await db.sql`SELECT body FROM conditions.smn_cap_message`).toHaveLength(2); - } finally { - await db.close(); - } -}); - it("bounds variants by count and combined original/provenance bytes before publication", async () => { const db = await createTestDatabase(); try { @@ -400,7 +371,7 @@ it("bounds variants by count and combined original/provenance bytes before publi await expect(smnMessages(db.sql, feed, variants, at)).rejects.toThrow("budget exceeded"); expect(await db.sql`SELECT body FROM conditions.smn_cap_message`).toHaveLength(0); const oversized = Buffer.alloc(32 * 1024 * 1024 + 1, 32); - await db.sql`INSERT INTO conditions.smn_cap_message(source_id,identifier,body,retain_until) VALUES (${feed.id},'synthetic-budget',${oversized},'2026-11-15T23:13:22Z')`; + await db.sql`INSERT INTO conditions.smn_cap_message(source_id,identifier,body,retrieval,retain_until) VALUES (${feed.id},'synthetic-budget',${oversized},${db.sql.json({ source: feed.id })},'2026-11-15T23:13:22Z')`; await expect(smnMessages(db.sql, feed, [], at)).rejects.toThrow("budget exceeded"); } finally { await db.close(); diff --git a/services/ingest/src/__tests__/smn.integration.test.ts b/services/ingest/src/__tests__/smn.integration.test.ts index e30289936..c1eaeb107 100644 --- a/services/ingest/src/__tests__/smn.integration.test.ts +++ b/services/ingest/src/__tests__/smn.integration.test.ts @@ -192,7 +192,7 @@ it("retains both hazards, exact durable bytes and validators after a malformed s const live = () => db.sql`SELECT id, record FROM conditions.situation WHERE source_id=${source.id} AND tombstoned_at IS NULL ORDER BY id`; const durable = () => - db.sql`SELECT identifier, body FROM conditions.smn_cap_message WHERE source_id=${source.id} ORDER BY identifier`; + db.sql`SELECT identifier, body FROM conditions.smn_cap_message WHERE source_id=${source.id} ORDER BY identifier, variant`; expect((await tick()).error).toBeUndefined(); expect(parser.running).toBe(true); const before = await live(); diff --git a/services/ingest/src/index.ts b/services/ingest/src/index.ts index 272ef1f9e..582f6edb2 100644 --- a/services/ingest/src/index.ts +++ b/services/ingest/src/index.ts @@ -24,6 +24,7 @@ import { registerPublishRoutes } from "./publish-routes.js"; import { RateLimiter, registerRateLimit } from "./rate-limit.js"; import { maintainPartitionsAtBoot, startRecordJobs } from "./record-jobs.js"; import { startScheduler } from "./scheduler.js"; +import { checkIngestSecrets, readIngestSecretsKey } from "./secrets-boot.js"; import { type BackgroundJob, InFlight, onceShutdown } from "./shutdown.js"; import { catalogueSources } from "./sources.js"; import { createTrustProxy } from "./trust-proxy.js"; @@ -41,11 +42,17 @@ async function boot() { const role = ingestRoleFromEnv(); // A malformed operator token fails boot before anything else runs. const operatorToken = role === "primary" ? operatorTokenFromEnv() : undefined; + // The OAuth2 grants' tokens are sealed with it: a missing or malformed key + // fails boot, and so, after the migrations, does one that is not the key + // the check row, the stored grants and the stored private keys were sealed + // with. + const secretsKey = readIngestSecretsKey(process.env); const crowd = resolveCrowdCredit(process.env, resolveInstanceId()); console.info(`[ingest] instance id ${resolveInstanceId()}, role ${role}`); console.info("[ingest] applying database migrations…"); await runMigrations(DATABASE_URL); console.info("[ingest] migrations applied"); + await checkIngestSecrets(sql, secretsKey); const model = productionRegistry(); const catalog = await loadIngestCatalog(); const plan = planIngest(catalog); @@ -99,6 +106,7 @@ async function boot() { const stopScheduler = startScheduler(sql, maintenanceSql, statusStore, catalog, { feeds: plan.feeds, primary, + secretsKey, inFlight, }); const stopRecordJobs = startRecordJobs(sql, maintenanceSql, { diff --git a/services/ingest/src/oauth-grants.ts b/services/ingest/src/oauth-grants.ts index 8b7f0e42c..e0ebb0832 100644 --- a/services/ingest/src/oauth-grants.ts +++ b/services/ingest/src/oauth-grants.ts @@ -1,3 +1,10 @@ +import { + assertStoredSecretsOpen, + type SecretPlace, + type SecretsKey, + type SecretTable, + storedSecret, +} from "@openconditions/core/server"; import { type OAuthGrantStore, OAuthGrants, @@ -10,14 +17,31 @@ export function grantLoginHint(key: string): string { return `log in with "node dist/feed-auth.js login ${key}" in the ingest container (see feeds/credentials.jsonc)`; } +/** The grants' table and the secrets it stores sealed. */ +export const OAUTH_GRANT_SECRETS: SecretTable = { + table: "oauth_grant", + rowKey: "grant_key", + columns: ["refresh_token", "access_token"], +}; + +const place = (column: string, key: string): SecretPlace => ({ + table: OAUTH_GRANT_SECRETS.table, + column, + row: key, +}); + const epoch = (value: unknown): number | null => value === null || value === undefined ? null : new Date(value as string | Date).getTime(); -function storedGrant(row: postgres.Row): StoredGrant { +function storedGrant(row: postgres.Row, secrets: SecretsKey): StoredGrant { + const key = row["grant_key"] as string; + const refresh = storedSecret(row, place("refresh_token", key)); + if (refresh === null) throw new Error(`conditions.oauth_grant ${key} has no refresh token`); + const access = storedSecret(row, place("access_token", key)); return { - refreshToken: row["refresh_token"] as string, + refreshToken: secrets.openText(refresh, place("refresh_token", key)), refreshIssuedAt: epoch(row["refresh_issued_at"]) as number, - accessToken: (row["access_token"] as string | null) ?? null, + accessToken: access === null ? null : secrets.openText(access, place("access_token", key)), accessExpiresAt: epoch(row["access_expires_at"]), rejectedAt: epoch(row["rejected_at"]), lastError: (row["last_error"] as string | null) ?? null, @@ -29,48 +53,75 @@ function storedGrant(row: postgres.Row): StoredGrant { const instant = (ms: number | null): Date | null => (ms === null ? null : new Date(ms)); /** - * The grants in `conditions.oauth_grant`. `locked` holds the grant's row - * (`SELECT … FOR UPDATE`) in a transaction for the whole of `fn`, so two - * ingest processes never spend one refresh token, and commits what `fn` - * wrote before it resolves. + * The grants in `conditions.oauth_grant`, their tokens sealed with + * `secrets`. `locked` holds the grant's row (`SELECT … FOR UPDATE`) in a + * transaction for the whole of `fn`, so two ingest processes never spend one + * refresh token, and commits what `fn` wrote before it resolves. */ -export function pgOAuthGrantStore(sql: postgres.Sql): OAuthGrantStore { +export function pgOAuthGrantStore(sql: postgres.Sql, secrets: SecretsKey): OAuthGrantStore { return { async read(key) { const [row] = await sql`SELECT * FROM conditions.oauth_grant WHERE grant_key = ${key}`; - return row ? storedGrant(row) : undefined; + return row ? storedGrant(row, secrets) : undefined; }, async locked(key, fn) { return (await sql.begin(async (tx) => { const [row] = await tx` SELECT * FROM conditions.oauth_grant WHERE grant_key = ${key} FOR UPDATE`; const write = async (next: StoredGrant) => { + const refresh = secrets.seal(next.refreshToken, place("refresh_token", key)); + const access = + next.accessToken === null + ? null + : secrets.seal(next.accessToken, place("access_token", key)); + const bytes = (value: Uint8Array | undefined) => + value === undefined ? null : Buffer.from(value); await tx` INSERT INTO conditions.oauth_grant ( - grant_key, refresh_token, refresh_issued_at, access_token, access_expires_at, - rejected_at, last_error, last_error_at, updated_at + grant_key, refresh_token_ciphertext, refresh_token_iv, refresh_token_tag, + refresh_issued_at, access_token_ciphertext, access_token_iv, access_token_tag, + access_expires_at, rejected_at, last_error, last_error_at, updated_at ) VALUES ( - ${key}, ${next.refreshToken}, ${new Date(next.refreshIssuedAt)}, - ${next.accessToken}, ${instant(next.accessExpiresAt)}, ${instant(next.rejectedAt)}, + ${key}, ${Buffer.from(refresh.ciphertext)}, ${Buffer.from(refresh.iv)}, + ${Buffer.from(refresh.tag)}, ${new Date(next.refreshIssuedAt)}, + ${bytes(access?.ciphertext)}, ${bytes(access?.iv)}, ${bytes(access?.tag)}, + ${instant(next.accessExpiresAt)}, ${instant(next.rejectedAt)}, ${next.lastError}, ${instant(next.lastErrorAt)}, ${new Date(next.updatedAt)} ) ON CONFLICT (grant_key) DO UPDATE SET - refresh_token = excluded.refresh_token, + refresh_token_ciphertext = excluded.refresh_token_ciphertext, + refresh_token_iv = excluded.refresh_token_iv, + refresh_token_tag = excluded.refresh_token_tag, refresh_issued_at = excluded.refresh_issued_at, - access_token = excluded.access_token, + access_token_ciphertext = excluded.access_token_ciphertext, + access_token_iv = excluded.access_token_iv, + access_token_tag = excluded.access_token_tag, access_expires_at = excluded.access_expires_at, rejected_at = excluded.rejected_at, last_error = excluded.last_error, last_error_at = excluded.last_error_at, updated_at = excluded.updated_at`; }; - return fn(row ? storedGrant(row) : undefined, write); + return fn(row ? storedGrant(row, secrets) : undefined, write); })) as Awaited>; }, }; } /** The process's grants, kept in the database `sql` reaches. */ -export function createOAuthGrants(sql: postgres.Sql, now: () => number = Date.now): OAuthGrants { - return new OAuthGrants(pgOAuthGrantStore(sql), { now, loginHint: grantLoginHint }); +export function createOAuthGrants( + sql: postgres.Sql, + secrets: SecretsKey, + now: () => number = Date.now, +): OAuthGrants { + return new OAuthGrants(pgOAuthGrantStore(sql, secrets), { now, loginHint: grantLoginHint }); +} + +/** + * Opens every stored grant's tokens under `secrets`, so a key that is not + * the one they were sealed with stops the start with a "wrong key" error + * naming the grant. + */ +export function assertGrantsOpen(sql: postgres.Sql, secrets: SecretsKey): Promise { + return assertStoredSecretsOpen(sql, secrets, OAUTH_GRANT_SECRETS); } diff --git a/services/ingest/src/ops/feed-auth.ts b/services/ingest/src/ops/feed-auth.ts index a42c612b6..c46425538 100644 --- a/services/ingest/src/ops/feed-auth.ts +++ b/services/ingest/src/ops/feed-auth.ts @@ -1,5 +1,6 @@ import { createInterface } from "node:readline/promises"; import { Writable } from "node:stream"; +import { secretsKeyFromEnv, verifySecretsKeyCheck } from "@openconditions/core/server"; import { authorizationUrl, type CatalogFeed, @@ -220,13 +221,18 @@ async function ask(question: string, opts: { secret: boolean }): Promise } async function main(): Promise { + // The ingest container's own key, which the grants' tokens are sealed with. + const secretsKey = secretsKeyFromEnv(process.env); const sql = postgres(requireCredential(process.env, "DATABASE_URL"), { max: 1 }); try { + // A key other than the one the ingest service sealed the check row with + // stops here, before a login is stored under it. + await verifySecretsKeyCheck(sql, secretsKey); const catalog = await loadIngestCatalog(); process.exitCode = await runFeedAuthCommand(process.argv.slice(2), { feeds: [...catalog.feeds, ...catalog.disabled], - grants: createOAuthGrants(sql), - store: pgOAuthGrantStore(sql), + grants: createOAuthGrants(sql, secretsKey), + store: pgOAuthGrantStore(sql, secretsKey), fetch: guardedFetch(undiciFetch as unknown as typeof fetch, guardOptionsFromEnv()), ask, out: (line) => process.stdout.write(`${line}\n`), diff --git a/services/ingest/src/pipeline/binding-metrics.ts b/services/ingest/src/pipeline/binding-metrics.ts index 895e2d5e8..5ee137546 100644 --- a/services/ingest/src/pipeline/binding-metrics.ts +++ b/services/ingest/src/pipeline/binding-metrics.ts @@ -1,3 +1,4 @@ +import type { BindingStatus } from "@openconditions/core"; import type postgres from "postgres"; type Sql = postgres.Sql; @@ -10,7 +11,6 @@ export interface BindingMetrics { unattempted: number; obsolete: number; unattemptedOrObsolete: number; - unknownStatus: number; exact: number; likely: number; ambiguous: number; @@ -38,8 +38,15 @@ export interface BindingReasonCount { /** Reads per-source binding metrics, keyed by the situation's source id. */ export type BindingMetricsReader = () => Promise>; -/** Maps the stored `record_binding.status` values onto the reported keys. */ -const STATUS_KEYS: Record> = { +/** + * Maps the stored `record_binding.status` values of a current binding onto + * the reported keys. Its CHECK keeps the column to `BindingStatus`, and this + * map has to name every status but `obsolete`, which is never current. + */ +const STATUS_KEYS: Record< + Exclude, + keyof Omit +> = { exact: "exact", likely: "likely", ambiguous: "ambiguous", @@ -56,7 +63,6 @@ function emptyMetrics(): BindingMetrics { unattempted: 0, obsolete: 0, unattemptedOrObsolete: 0, - unknownStatus: 0, exact: 0, likely: 0, ambiguous: 0, @@ -69,16 +75,14 @@ function emptyMetrics(): BindingMetrics { /** * Per-source binding outcome counts, cached for `ttlMs` so a status poll costs - * at most two GROUP BYs per refresh window. An unrecognised status still counts - * toward `attempted` — the total must stay truthful even if the resolver grows - * an outcome this reader does not know about yet. + * at most two GROUP BYs per refresh window. */ export function createBindingMetricsReader(sql: Sql, ttlMs = 60_000): BindingMetricsReader { let cache: { at: number; value: Map } | null = null; return async () => { if (cache && Date.now() - cache.at < ttlMs) return cache.value; const rows = await sql< - { source: string; status: string | null; binding_current: boolean; n: number }[] + { source: string; status: BindingStatus | null; binding_current: boolean; n: number }[] >` SELECT s.source_id AS source, b.status, CASE WHEN b.status IS NULL OR b.status = 'obsolete' THEN false @@ -109,9 +113,7 @@ export function createBindingMetricsReader(sql: Sql, ttlMs = 60_000): BindingMet metrics.unattemptedOrObsolete += row.n; } else { metrics.attemptedCurrent += row.n; - const key = STATUS_KEYS[row.status]; - if (key) metrics[key] += row.n; - else metrics.unknownStatus += row.n; + metrics[STATUS_KEYS[row.status]] += row.n; } } value.set(row.source, metrics); diff --git a/services/ingest/src/pipeline/segment-speed.ts b/services/ingest/src/pipeline/segment-speed.ts index e7b38ccdd..0936aa227 100644 --- a/services/ingest/src/pipeline/segment-speed.ts +++ b/services/ingest/src/pipeline/segment-speed.ts @@ -116,7 +116,7 @@ export async function writeSensorObservations( WHERE site.speed IS NOT NULL OR site.los <> 'unknown' ) INSERT INTO conditions.segment_observation - (segment_id, source, source_tier, current_kph, free_flow_kph, speed_ratio, los, confidence, sample_count, observed_at, expires_at, native_field_sources, field_sources, field_contributors, field_lineage_complete, permission_licenses) + (segment_id, source, source_tier, current_kph, free_flow_kph, speed_ratio, los, confidence_score, sample_count, observed_at, expires_at, native_field_sources, field_sources, field_contributors, field_lineage_complete, permission_licenses) SELECT agg.segment_id, agg.source, 'sensor', agg.current_kph, agg.free_flow_kph, agg.speed_ratio, CASE @@ -187,7 +187,7 @@ export async function writeSensorObservations( ) agg ON CONFLICT (segment_id, source) DO UPDATE SET current_kph=EXCLUDED.current_kph, free_flow_kph=EXCLUDED.free_flow_kph, speed_ratio=EXCLUDED.speed_ratio, - los=EXCLUDED.los, confidence=EXCLUDED.confidence, sample_count=EXCLUDED.sample_count, + los=EXCLUDED.los, confidence_score=EXCLUDED.confidence_score, sample_count=EXCLUDED.sample_count, observed_at=EXCLUDED.observed_at, expires_at=EXCLUDED.expires_at, native_field_sources=EXCLUDED.native_field_sources, field_lineage_complete=EXCLUDED.field_lineage_complete, field_contributors=EXCLUDED.field_contributors, field_sources=EXCLUDED.field_sources, permission_licenses=EXCLUDED.permission_licenses @@ -225,7 +225,7 @@ export async function fuseSegmentSpeed( // their proven field origins with the measurement, before it reaches fusion. await sql`DELETE FROM conditions.segment_speed WHERE is_estimated = false`; - // Confidence is a producer-derived class, not observation.confidence: + // Confidence is a producer-derived class, not segment_observation.confidence_score: // measured credits the selected speed input when present, otherwise the // selected declared LOS ties. Estimated confidence also depends on the OSM // geometry used to bind/propagate that donor, even with no target baseline. diff --git a/services/ingest/src/pipeline/smn-messages.ts b/services/ingest/src/pipeline/smn-messages.ts index 6a44f2576..fd9eb6ef7 100644 --- a/services/ingest/src/pipeline/smn-messages.ts +++ b/services/ingest/src/pipeline/smn-messages.ts @@ -51,7 +51,7 @@ export async function smnMessages( const at = Date.parse(now); const rows = await sql< { identifier: string; body: Buffer; retrieval: unknown; retain_until: Date }[] - >`SELECT identifier, body, retrieval, retain_until FROM conditions.smn_cap_message WHERE source_id=${feed.id} AND retain_until > ${now}::timestamptz ORDER BY identifier LIMIT 4097`; + >`SELECT identifier, body, retrieval, retain_until FROM conditions.smn_cap_message WHERE source_id=${feed.id} AND retain_until > ${now}::timestamptz ORDER BY identifier, variant LIMIT 4097`; const decision = await sql< { version: string }[] >`SELECT xmin::text AS version FROM conditions.smn_cap_decision WHERE source_id=${feed.id}`; @@ -130,7 +130,7 @@ export async function checkSmnWindow( ): Promise { const rows = await tx< { identifier: string; body: Buffer; retain_until: Date; retrieval: unknown }[] - >`SELECT identifier, body, retain_until, retrieval FROM conditions.smn_cap_message WHERE source_id=${sourceId} AND retain_until > ${now}::timestamptz ORDER BY identifier`; + >`SELECT identifier, body, retain_until, retrieval FROM conditions.smn_cap_message WHERE source_id=${sourceId} AND retain_until > ${now}::timestamptz ORDER BY identifier, variant`; const decision = await tx< { version: string }[] >`SELECT xmin::text AS version FROM conditions.smn_cap_decision WHERE source_id=${sourceId}`; diff --git a/services/ingest/src/scheduler.ts b/services/ingest/src/scheduler.ts index d3e353ea3..2c423291b 100644 --- a/services/ingest/src/scheduler.ts +++ b/services/ingest/src/scheduler.ts @@ -1,5 +1,6 @@ import { createHash } from "node:crypto"; import { join } from "node:path"; +import type { SecretsKey } from "@openconditions/core/server"; import { type Catalog, type CatalogFeed, @@ -295,6 +296,8 @@ export interface SchedulerOptions { * leave their binding work queued for the primary's next drain. */ primary: boolean; + /** The key the OAuth2 grants' tokens are sealed with in the database. */ + secretsKey: SecretsKey; /** Tracks the feed polls and the binding queue's drain, so shutdown waits for them. */ inFlight?: Pick; } @@ -324,7 +327,7 @@ export function startScheduler( // And one child process that parses them, so the event loop stays free meanwhile. const parseProcess = createParseProcess(); // One holder of the OAuth2 grants, so the feeds of one account share its access token. - const grants = createOAuthGrants(sql); + const grants = createOAuthGrants(sql, opts.secretsKey); const bindingDrain = opts.primary ? createBindingDrain( () => defaultDrainBindingQueue(sql, { now: () => new Date().toISOString() }), diff --git a/services/ingest/src/secrets-boot.ts b/services/ingest/src/secrets-boot.ts new file mode 100644 index 000000000..e681aae72 --- /dev/null +++ b/services/ingest/src/secrets-boot.ts @@ -0,0 +1,34 @@ +import { + assertStoredSecretsOpen, + type CredentialEnv, + INSTANCE_KEY_SECRETS, + ISSUER_KEY_SECRETS, + type SecretsKey, + sealSecretsKeyCheck, + secretsKeyFromEnv, +} from "@openconditions/core/server"; +import type postgres from "postgres"; +import { assertGrantsOpen } from "./oauth-grants.js"; + +/** + * The secrets key, read before the migrations so a missing or malformed key + * stops the start before anything touches the database. + */ +export function readIngestSecretsKey(env: CredentialEnv): SecretsKey { + return secretsKeyFromEnv(env); +} + +/** + * After the migrations: opens every stored OAuth2 grant, issuer key and + * federation instance key, then seals the secrets key check row the other + * services verify their key against (once; a row already there must open + * with this key). A key that is not the one in use stops the start, naming + * what it could not open; the stored secrets come first, so such a key never + * seals the check row, even when the row was deleted by hand. + */ +export async function checkIngestSecrets(sql: postgres.Sql, key: SecretsKey): Promise { + await assertGrantsOpen(sql, key); + await assertStoredSecretsOpen(sql, key, ISSUER_KEY_SECRETS); + await assertStoredSecretsOpen(sql, key, INSTANCE_KEY_SECRETS); + await sealSecretsKeyCheck(sql, key); +} diff --git a/services/openlr-resolver/README.md b/services/openlr-resolver/README.md index bd4378766..0803cbad5 100644 --- a/services/openlr-resolver/README.md +++ b/services/openlr-resolver/README.md @@ -90,18 +90,20 @@ Returns `200 { "status": "ok" }`. ## The road graph -Matching runs against a graph in two PostGIS tables (`DATABASE_URL` selects the -database, same convention as the ingest service): - -- `conditions.osm_nodes(node_id BIGINT PK, geom geometry(Point,4326))` -- `conditions.osm_lines(line_id BIGSERIAL PK, way_id BIGINT, start_node BIGINT, - end_node BIGINT, frc SMALLINT, fow SMALLINT, oneway BOOLEAN, - geom geometry(LineString,4326))` - -Each `osm_lines` row is one **directed** edge. A one-way OSM way yields one -edge; a bidirectional way yields a forward and a reversed edge, so travel -direction is always explicit (OpenLR matching is direction-sensitive). Both -tables get a GiST index on `geom`. +Matching runs against a graph in two PostGIS tables in the schema `openlr` (`DATABASE_URL` selects the database, same convention as the ingest service): + +- `openlr.osm_nodes(node_id BIGINT PK, geom geometry(Point,4326))` +- `openlr.osm_lines(line_id BIGINT identity PK, way_id BIGINT, start_node BIGINT, end_node BIGINT, frc SMALLINT, fow SMALLINT, oneway BOOLEAN, geom geometry(LineString,4326))` + +Each `osm_lines` row is one **directed** edge. A one-way OSM way yields one edge; a bidirectional way yields a forward and a reversed edge, so travel direction is always explicit (OpenLR matching is direction-sensitive). Both tables get a GiST index on `geom::geography`, and `osm_lines` an index on each of `start_node` and `end_node`. + +### Database roles + +The graph never lives in `conditions`, which belongs to the ingest service and its migrations. No deployment, OpenMapX's included, runs the resolver today, so no role is created for it. When one does, the graph build and the service connect as their own roles, never as the ingest service's or the superuser: + +- The build role owns `openlr`. Every build drops and creates the two tables again, which only their owner may do. The build creates the schema when it is missing, which takes `CREATE` on the database; without that right the operator creates the schema for it, with `CREATE SCHEMA openlr AUTHORIZATION `, and the build uses it as it is. +- The service's role reads the graph and writes nothing. It needs `USAGE` on `openlr` and `SELECT` on both tables. A build replaces the tables, which drops their grants, so grant the reads as default privileges of the build role: `ALTER DEFAULT PRIVILEGES FOR ROLE IN SCHEMA openlr GRANT SELECT ON TABLES TO `. +- The code qualifies the table names with `openlr` but not PostGIS's types and functions, and sets no search path. Where PostGIS is installed in its own schema, as in OpenMapX's database (`extensions`), set both roles' search path to `openlr, extensions` with `ALTER ROLE … SET search_path`. ### OSM → FRC/FOW mapping diff --git a/services/openlr-resolver/app/maps/postgis.py b/services/openlr-resolver/app/maps/postgis.py index 287d19b19..e5fb31cd6 100644 --- a/services/openlr-resolver/app/maps/postgis.py +++ b/services/openlr-resolver/app/maps/postgis.py @@ -3,13 +3,17 @@ """A PostGIS-backed `MapReader` over the OSM-derived road graph. -The graph lives in two tables, populated by ``scripts/build_graph.py``: +The graph lives in two tables in the schema ``openlr``, populated by +``scripts/build_graph.py``: -* ``conditions.osm_nodes(node_id BIGINT PRIMARY KEY, geom geometry(Point,4326))`` -* ``conditions.osm_lines(line_id BIGINT PRIMARY KEY, way_id BIGINT, - start_node BIGINT, end_node BIGINT, frc SMALLINT, fow SMALLINT, +* ``openlr.osm_nodes(node_id BIGINT PRIMARY KEY, geom geometry(Point,4326))`` +* ``openlr.osm_lines(line_id BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY, + way_id BIGINT, start_node BIGINT, end_node BIGINT, frc SMALLINT, fow SMALLINT, oneway BOOLEAN, geom geometry(LineString,4326))`` +Table names are schema-qualified; PostGIS's types and functions are not, so the +connecting role's search path must include the schema PostGIS is installed in. + Each row in ``osm_lines`` is one **directed** edge: a one-way OSM way yields a single line, a bidirectional way yields two (forward and reversed). The line's ``start_node``/``end_node`` therefore always describe travel direction, which is @@ -42,12 +46,12 @@ from openlr_dereferencer.maps.wgs84 import distance, line_string_length -_NODES = "conditions.osm_nodes" -_LINES = "conditions.osm_lines" +_NODES = "openlr.osm_nodes" +_LINES = "openlr.osm_lines" class PostgisLine(AbstractLine): - """A directed edge loaded lazily from ``conditions.osm_lines``.""" + """A directed edge loaded lazily from ``openlr.osm_lines``.""" def __init__(self, reader: "PostgisMapReader", line_id: int) -> None: self._reader = reader @@ -91,7 +95,7 @@ def distance_to(self, coord: Coordinates) -> float: class PostgisNode(AbstractNode): - """A graph node loaded lazily from ``conditions.osm_nodes``.""" + """A graph node loaded lazily from ``openlr.osm_nodes``.""" def __init__(self, reader: "PostgisMapReader", node_id: int) -> None: self._reader = reader diff --git a/services/openlr-resolver/scripts/build_graph.py b/services/openlr-resolver/scripts/build_graph.py index 97d0523c7..39621ff51 100644 --- a/services/openlr-resolver/scripts/build_graph.py +++ b/services/openlr-resolver/scripts/build_graph.py @@ -6,14 +6,17 @@ Reads an ``.osm.pbf`` (or ``.osm`` XML) file with pyosmium, keeps drivable ``highway=*`` ways, classifies each into an OpenLR Functional Road Class and -Form of Way (see :mod:`app.frc_fow`), and loads two tables: +Form of Way (see :mod:`app.frc_fow`), and loads two tables in the schema +``openlr``, which belongs to the role that builds the graph: -* ``conditions.osm_nodes`` — every node referenced by a kept way. -* ``conditions.osm_lines`` — one **directed** edge per consecutive node pair of +* ``openlr.osm_nodes`` — every node referenced by a kept way. +* ``openlr.osm_lines`` — one **directed** edge per consecutive node pair of a kept way. Bidirectional ways produce both a forward and a reversed edge so travel direction is always explicit, which OpenLR matching requires. Both tables get a GiST index on ``geom::geography`` for metre-based searches. +The schema is created only when it is missing, so a role without ``CREATE`` on +the database can build into a schema the operator created for it. Usage:: @@ -96,55 +99,63 @@ def build_graph(osm_path: str) -> Graph: return graph -DDL = """ -CREATE SCHEMA IF NOT EXISTS conditions; +# `CREATE SCHEMA IF NOT EXISTS` would require CREATE on the database even when +# the schema exists, so the loader checks for the schema first. +CREATE_SCHEMA = "CREATE SCHEMA openlr" -DROP TABLE IF EXISTS conditions.osm_lines; -DROP TABLE IF EXISTS conditions.osm_nodes; +DDL = """ +DROP TABLE IF EXISTS openlr.osm_lines; +DROP TABLE IF EXISTS openlr.osm_nodes; -CREATE TABLE conditions.osm_nodes ( - node_id BIGINT PRIMARY KEY, - geom geometry(Point, 4326) NOT NULL +CREATE TABLE openlr.osm_nodes ( + node_id BIGINT NOT NULL, + geom geometry(Point, 4326) NOT NULL, + CONSTRAINT osm_nodes_pkey PRIMARY KEY (node_id) ); -CREATE TABLE conditions.osm_lines ( - line_id BIGSERIAL PRIMARY KEY, +CREATE TABLE openlr.osm_lines ( + line_id BIGINT GENERATED BY DEFAULT AS IDENTITY, way_id BIGINT NOT NULL, start_node BIGINT NOT NULL, end_node BIGINT NOT NULL, frc SMALLINT NOT NULL, fow SMALLINT NOT NULL, oneway BOOLEAN NOT NULL, - geom geometry(LineString, 4326) NOT NULL + geom geometry(LineString, 4326) NOT NULL, + CONSTRAINT osm_lines_pkey PRIMARY KEY (line_id) ); """ INDEXES = """ -CREATE INDEX osm_nodes_geography_idx ON conditions.osm_nodes USING GIST ((geom::geography)); -CREATE INDEX osm_lines_geography_idx ON conditions.osm_lines USING GIST ((geom::geography)); -CREATE INDEX osm_lines_start_idx ON conditions.osm_lines (start_node); -CREATE INDEX osm_lines_end_idx ON conditions.osm_lines (end_node); +CREATE INDEX osm_nodes_geography_idx ON openlr.osm_nodes USING GIST ((geom::geography)); +CREATE INDEX osm_lines_geography_idx ON openlr.osm_lines USING GIST ((geom::geography)); +CREATE INDEX osm_lines_start_node_idx ON openlr.osm_lines (start_node); +CREATE INDEX osm_lines_end_node_idx ON openlr.osm_lines (end_node); """ +NODES_COPY = "COPY openlr.osm_nodes (node_id, geom) FROM STDIN" + +LINES_COPY = ( + "COPY openlr.osm_lines (way_id, start_node, end_node, frc, fow, oneway, geom) FROM STDIN" +) + def load_into_postgis(graph: Graph, database_url: str) -> tuple[int, int]: - """Create the schema and bulk-load the graph. Returns (node_count, edge_count).""" + """Create the tables and bulk-load the graph. Returns (node_count, edge_count).""" with psycopg.connect(database_url) as conn: with conn.cursor() as cur: cur.execute("CREATE EXTENSION IF NOT EXISTS postgis") + cur.execute("SELECT to_regnamespace('openlr') IS NULL") + if cur.fetchone()[0]: + cur.execute(CREATE_SCHEMA) cur.execute(DDL) - with cur.copy( - "COPY conditions.osm_nodes (node_id, geom) FROM STDIN" - ) as copy: + with cur.copy(NODES_COPY) as copy: for node_id, (lon, lat) in graph.nodes.items(): copy.write_row((node_id, f"SRID=4326;POINT({lon} {lat})")) - with cur.copy( - "COPY conditions.osm_lines " - "(way_id, start_node, end_node, frc, fow, oneway, geom) FROM STDIN" - ) as copy: + with cur.copy(LINES_COPY) as copy: for way_id, a, b, frc, fow, oneway, wkt in graph.edges: copy.write_row((way_id, a, b, frc, fow, oneway, f"SRID=4326;{wkt}")) diff --git a/services/openlr-resolver/tests/test_build_graph.py b/services/openlr-resolver/tests/test_build_graph.py index 4d4080cce..2391d6ca5 100644 --- a/services/openlr-resolver/tests/test_build_graph.py +++ b/services/openlr-resolver/tests/test_build_graph.py @@ -1,17 +1,53 @@ # Copyright the OpenConditions authors. # SPDX-License-Identifier: Apache-2.0 -"""Unit tests for OSM parsing and FRC/FOW classification (no database).""" +"""Unit tests for OSM parsing, FRC/FOW classification and the graph SQL (no database).""" from __future__ import annotations +import re from pathlib import Path from app.frc_fow import Frc, Fow, classify, is_oneway, is_reversed_oneway +from app.maps import postgis +from scripts import build_graph as graph_build from scripts.build_graph import build_graph FIXTURE = Path(__file__).parent / "fixtures" / "tiny_roads.osm" +GRAPH_SQL = "\n".join( + [ + graph_build.CREATE_SCHEMA, + graph_build.DDL, + graph_build.INDEXES, + graph_build.NODES_COPY, + graph_build.LINES_COPY, + ] +) + + +def test_graph_sql_touches_only_the_openlr_schema() -> None: + qualified = set(re.findall(r"\b(\w+)\.(osm_\w+)\b", GRAPH_SQL)) + assert qualified == {("openlr", "osm_nodes"), ("openlr", "osm_lines")} + assert graph_build.CREATE_SCHEMA == "CREATE SCHEMA openlr" + assert "conditions" not in GRAPH_SQL + # The reader queries the same tables the build writes. + assert (postgis._NODES, postgis._LINES) == ("openlr.osm_nodes", "openlr.osm_lines") + + +def test_graph_ddl_uses_identity_and_conventional_names() -> None: + assert "serial" not in graph_build.DDL.lower() + assert "line_id BIGINT GENERATED BY DEFAULT AS IDENTITY" in graph_build.DDL + assert "CONSTRAINT osm_nodes_pkey PRIMARY KEY (node_id)" in graph_build.DDL + assert "CONSTRAINT osm_lines_pkey PRIMARY KEY (line_id)" in graph_build.DDL + indexes = re.findall(r"CREATE INDEX (\w+) ON openlr\.(\w+)", graph_build.INDEXES) + assert sorted(indexes) == [ + ("osm_lines_end_node_idx", "osm_lines"), + ("osm_lines_geography_idx", "osm_lines"), + ("osm_lines_start_node_idx", "osm_lines"), + ("osm_nodes_geography_idx", "osm_nodes"), + ] + def test_classify_road_classes() -> None: assert classify({"highway": "motorway"}) == (Frc.FRC0, Fow.MOTORWAY) diff --git a/services/openlr-resolver/tests/test_postgis_mode.py b/services/openlr-resolver/tests/test_postgis_mode.py index 0597b22f5..e77de30b6 100644 --- a/services/openlr-resolver/tests/test_postgis_mode.py +++ b/services/openlr-resolver/tests/test_postgis_mode.py @@ -92,7 +92,7 @@ def test_optional_unavailable_database_skips(tmp_path, mode, block): result = run_pytest(tmp_path, mode=mode, block=block) assert result.returncode == 0, result.stdout + result.stderr cases = ET.parse(tmp_path / "results.xml").findall(".//testcase") - assert len(cases) == 4 + assert len(cases) == 5 assert all(case.find("skipped") is not None for case in cases) @@ -141,7 +141,7 @@ def test_required_database_import_failure_is_not_a_skip(tmp_path): result = run_pytest(tmp_path, block="psycopg_pool", docker_host=host) assert result.returncode != 0, result.stdout + result.stderr assert "deliberately unavailable dependency: psycopg_pool" in result.stdout + result.stderr - assert "4 errors" in result.stdout + assert "5 errors" in result.stdout assert not any(method == "POST" for method, _ in requests) diff --git a/services/openlr-resolver/tests/test_postgis_reader.py b/services/openlr-resolver/tests/test_postgis_reader.py index 65bc868a2..ec898a916 100644 --- a/services/openlr-resolver/tests/test_postgis_reader.py +++ b/services/openlr-resolver/tests/test_postgis_reader.py @@ -35,7 +35,7 @@ def _bearing_deg(a, b) -> float: @pytest.fixture(scope="module") -def pg_reader(postgis_required, record_testsuite_property): +def pg_url(postgis_required): unavailable = pytest.fail if postgis_required else pytest.skip context = "OPENLR_POSTGIS_TESTS=required" if postgis_required else "optional PostGIS tests" try: @@ -54,28 +54,100 @@ def pg_reader(postgis_required, record_testsuite_property): if client is not None: client.close() + # Import the database dependencies before a container starts, so a missing one fails + # without starting it. + import app.maps.postgis # noqa: F401 + import psycopg_pool # noqa: F401 + + with PostgresContainer("postgis/postgis:16-3.4", driver=None) as pg: + yield pg.get_connection_url() + + +@pytest.fixture(scope="module") +def pg_reader(pg_url, record_testsuite_property): from app.maps.postgis import PostgisMapReader from psycopg_pool import ConnectionPool from scripts.build_graph import build_graph, load_into_postgis - with PostgresContainer("postgis/postgis:16-3.4", driver=None) as pg: - url = pg.get_connection_url() - graph = build_graph(str(FIXTURE)) - nodes, edges = load_into_postgis(graph, url) - assert nodes > 0 and edges > 0 - - pool = ConnectionPool(url, min_size=1, max_size=3, open=True) - try: - with pool.connection() as conn: - version = int(conn.execute("SHOW server_version_num").fetchone()[0]) - assert version // 10000 == 16, f"Expected PostgreSQL 16, got {version}" - record_testsuite_property("postgis_server_version_num", version) - record_testsuite_property("postgis_version", conn.execute( - "SELECT PostGIS_Version()" - ).fetchone()[0]) - yield PostgisMapReader(pool) - finally: - pool.close() + graph = build_graph(str(FIXTURE)) + nodes, edges = load_into_postgis(graph, pg_url) + assert nodes > 0 and edges > 0 + + pool = ConnectionPool(pg_url, min_size=1, max_size=3, open=True) + try: + with pool.connection() as conn: + version = int(conn.execute("SHOW server_version_num").fetchone()[0]) + assert version // 10000 == 16, f"Expected PostgreSQL 16, got {version}" + record_testsuite_property("postgis_server_version_num", version) + record_testsuite_property("postgis_version", conn.execute( + "SELECT PostGIS_Version()" + ).fetchone()[0]) + yield PostgisMapReader(pool) + finally: + pool.close() + + +def test_graph_builds_and_reads_with_only_the_documented_rights(pg_url) -> None: + # A database laid out as under OpenMapX: PostGIS in `extensions`, an operator-created + # `openlr` schema owned by the build role, which holds no CREATE on the database, and + # a read role with USAGE on the schema and SELECT through default privileges. + import psycopg + from psycopg.conninfo import make_conninfo + from psycopg_pool import ConnectionPool + + from app.maps.postgis import PostgisMapReader + from scripts.build_graph import build_graph, load_into_postgis + + database = "openlr_rights" + with psycopg.connect(pg_url, autocommit=True) as conn: + conn.execute(f"CREATE DATABASE {database} TEMPLATE template0") + conn.execute("CREATE ROLE openlr_build LOGIN PASSWORD 'openlr_build'") + conn.execute("CREATE ROLE openlr_read LOGIN PASSWORD 'openlr_read'") + admin_url = make_conninfo(pg_url, dbname=database) + with psycopg.connect(admin_url, autocommit=True) as conn: + conn.execute("CREATE SCHEMA extensions") + conn.execute("GRANT USAGE ON SCHEMA extensions TO PUBLIC") + conn.execute("CREATE EXTENSION postgis SCHEMA extensions") + for role in ("openlr_build", "openlr_read"): + conn.execute( + f"ALTER ROLE {role} IN DATABASE {database} SET search_path = openlr, extensions" + ) + conn.execute("CREATE SCHEMA openlr AUTHORIZATION openlr_build") + conn.execute("GRANT USAGE ON SCHEMA openlr TO openlr_read") + conn.execute( + "ALTER DEFAULT PRIVILEGES FOR ROLE openlr_build IN SCHEMA openlr " + "GRANT SELECT ON TABLES TO openlr_read" + ) + assert conn.execute( + f"SELECT has_database_privilege('openlr_build', '{database}', 'CREATE')" + ).fetchone() == (False,) + + build_url = make_conninfo(admin_url, user="openlr_build", password="openlr_build") + read_url = make_conninfo(admin_url, user="openlr_read", password="openlr_read") + graph = build_graph(str(FIXTURE)) + # A rebuild drops and creates the tables again; the reader keeps its access. + for _ in range(2): + assert load_into_postgis(graph, build_url) == (5, 5) + + with psycopg.connect(admin_url) as conn: + assert conn.execute("SELECT to_regnamespace('conditions')").fetchone() == (None,) + owners = conn.execute( + "SELECT tablename, tableowner FROM pg_tables WHERE schemaname = 'openlr' ORDER BY 1" + ).fetchall() + assert owners == [("osm_lines", "openlr_build"), ("osm_nodes", "openlr_build")] + + pool = ConnectionPool(read_url, min_size=1, max_size=1, open=True) + try: + reader = PostgisMapReader(pool) + assert reader.get_linecount() == 5 + assert reader.get_nodecount() == 5 + (node,) = reader.find_nodes_close_to(Coordinates(*NODE_A), 50) + assert (node.coordinates.lon, node.coordinates.lat) == pytest.approx(NODE_A) + with pool.connection() as conn: + with pytest.raises(psycopg.errors.InsufficientPrivilege): + conn.execute("DELETE FROM openlr.osm_lines") + finally: + pool.close() def test_postgis_reader_loads_graph(pg_reader) -> None: @@ -129,22 +201,22 @@ def test_proximity_uses_geography_indexes_without_changing_results(pg_reader) -> with pg_reader._pool.connection() as conn: with conn.transaction(force_rollback=True): conn.execute(""" - INSERT INTO conditions.osm_nodes + INSERT INTO openlr.osm_nodes SELECT 100000+i, ST_SetSRID(ST_MakePoint( 8+(i%200)*0.001, 50+(i/200)*0.001),4326) FROM generate_series(1,20000) i """) conn.execute(""" - INSERT INTO conditions.osm_lines + INSERT INTO openlr.osm_lines (line_id,way_id,start_node,end_node,frc,fow,oneway,geom) SELECT node_id,1,node_id,node_id+1,3,3,true, ST_MakeLine(geom,ST_Translate(geom,0.0005,0)) - FROM conditions.osm_nodes WHERE node_id > 100000 + FROM openlr.osm_nodes WHERE node_id > 100000 """) for table, ident in [("osm_nodes", "node_id"), ("osm_lines", "line_id")]: - conn.execute(f"ANALYZE conditions.{table}") + conn.execute(f"ANALYZE openlr.{table}") query = ( - f"SELECT {ident} FROM conditions.{table} WHERE " + f"SELECT {ident} FROM openlr.{table} WHERE " "ST_DWithin(geom::geography, " "ST_SetSRID(ST_MakePoint(8.1,50.05),4326)::geography,100)" )